-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define AppConfigDescriptor with JSON instead of string #649
base: develop
Are you sure you want to change the base?
Define AppConfigDescriptor with JSON instead of string #649
Conversation
"appConfigDefaultConfiguration": { | ||
"GOOGLE_MAP": false, | ||
"VIEW_ASSOCIATED_PROJECTS": false, | ||
"PROVENANCE_DOCKER_IMAGES": false, | ||
"JSONSCHEMA_VALIDATION_STATUS": false, | ||
"DESCRIPTION_FIELD": false, | ||
"ADD_WIKI_WIDGETS": false, | ||
"WIKI_DIFF_TOOL": false, | ||
"CUSTOM_STORAGE_LOCATION_SETTINGS": false, | ||
"CHALLENGE_SUBMISSION_SETTINGS": false, | ||
"PROVENANCE_V2_VISUALIZATION": true, | ||
"VIRTUALTABLE_SUPPORT": false, | ||
"SRC_BASED_AR_MODAL_WIZARD": false, | ||
"REACT_ENTITY_ACL_EDITOR": true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this must be JSON
@@ -35,7 +35,7 @@ | |||
"Ref": "dev101portalAppConfigConfigProfile" | |||
}, | |||
"Description": "Freeform config for toggling experimental mode features", | |||
"Content": "{\"GOOGLE_MAP\": false, \"VIEW_ASSOCIATED_PROJECTS\": false, \"PROVENANCE_DOCKER_IMAGES\": false, \"JSONSCHEMA_VALIDATION_STATUS\": false, \"DESCRIPTION_FIELD\": false, \"ADD_WIKI_WIDGETS\": false, \"WIKI_DIFF_TOOL\": false, \"CUSTOM_STORAGE_LOCATION_SETTINGS\": false, \"CHALLENGE_SUBMISSION_SETTINGS\": false, \"PROVENANCE_V2_VISUALIZATION\": true, \"VIRTUALTABLE_SUPPORT\": false, \"SRC_BASED_AR_MODAL_WIZARD\": false, \"REACT_ENTITY_ACL_EDITOR\": true}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to remove spaces because those are lost on serialization
ObjectMapper mapper = new ObjectMapper(); | ||
try { | ||
this.appConfigDefaultConfiguration = mapper.writeValueAsString(mapper.writeValueAsString(appConfigDefaultConfiguration)); | ||
} catch (JsonProcessingException e) { | ||
throw new IllegalArgumentException("Failed to serialize appConfigDefaultConfiguration", e); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to pass a string to CloudFormation, so use Jackson to serialize the object to a string twice, which will give us properly-escaped stringified JSON.
No description provided.