From 1a7a60d88c08f9a3c62d45d1476f20cdb5df54fa Mon Sep 17 00:00:00 2001 From: chasegawa Date: Thu, 7 Oct 2021 11:26:36 -0700 Subject: [PATCH] SHIBUI-2151 Changes per ryan to backend schema --- .../admin/ui/service/JsonSchemaBuilderService.groovy | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JsonSchemaBuilderService.groovy b/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JsonSchemaBuilderService.groovy index 622b91f0a..ee44ce794 100644 --- a/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JsonSchemaBuilderService.groovy +++ b/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JsonSchemaBuilderService.groovy @@ -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