Skip to content

Commit

Permalink
SHIBUI-2151
Browse files Browse the repository at this point in the history
Changes per ryan to backend schema
  • Loading branch information
chasegawa committed Oct 7, 2021
1 parent 2ed9b10 commit 1a7a60d
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,18 @@ class JsonSchemaBuilderService {
def definition = [title : it['displayName'],
description: it['helpText'],
type : 'array']
definition['uniqueItems'] = false
def items = [type : 'string',
minLength: 1, // TODO: should this be configurable?
maxLength: 255] //TODO: or this?
items.enum = it['examples']
if (it['displayType'] == 'set' || it['displayType'] == 'selection_list') {
definition['uniqueItems'] = true
items.examples = it['examples']
} else if (it['displayType'] == 'list') {
definition['uniqueItems'] = false
items.enum = it['examples']
}

items['default'] = it['defaultValue']


definition['items'] = items
json[(String) it['name']] = definition
Expand Down

0 comments on commit 1a7a60d

Please sign in to comment.