-
Notifications
You must be signed in to change notification settings - Fork 75
[SYNPY-1766] Use of display names in JSON Schema creation is not the default #1318
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
Conversation
| | `data_model_path` | Positional | Data model path or URL | | ||
| | `--data-types` | Named | Optional list of data types to create JSON Schema for | | ||
| | `--output` | Named | Optional. Either a file path ending in '.json', or a directory path | | ||
| | `--use-property-display-names` | Named | Optional. Defaults to False. Formats the property name strings in the JSON Schema | |
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.
From a product perspective: May want to add in a note about how we do formatting here because Synapse does not accept annotation keys that have special character or spaces.
| | `--data-types` | Named | Optional list of data types to create JSON Schema for | | ||
| | `--output` | Named | Optional. Either a file path ending in '.json', or a directory path | | ||
| | `--use-property-display-names` | Named | Optional. Defaults to False. Formats the property name strings in the JSON Schema | | ||
| | `--use-valid-value-display-names` | Named | Optional. Defaults to False. Formats the valid value strings in the JSON Schema | |
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.
From a product perspective, it is a bit unclear why we actually have this field. I'm not entirely sure there are use cases for updating the valid value strings themselves? Although I think the complexity is going to be conditionals.
If the property name is "DataType" after --use-property-display-names but then the valid value is "Data Type" that will potentially cause a mismatch.
The other note, we definitely want DCC's to continue providing valid values like this:
enum:
- "ab cd"
- "bc dd"
- "cd ff"
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.
@thomasyu888 This is a great question. Is there any reason to format valid values? It's only there because the original method did this, I just added the ability to turn it off.
| | `data_model_path` | Positional | Data model path or URL | | ||
| | `--data-types` | Named | Optional list of data types to create JSON Schema for | | ||
| | `--output` | Named | Optional. Either a file path ending in '.json', or a directory path | | ||
| | `--data-model-labels` | Named | Either 'class_label', or 'display_label' | |
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.
I am technically ok with this backwards incompatible change, but then should this upcoming package release be 5.0.0? or should this deprecation be done in a different method?
|
@thomasyu888 You brought up some good points. I moved this to draft. I'm going to think about this some more. |
Problem:
The curator extension was changing property names and valid values to the "display-name" version of those by default.
Solution:
This behavior has been turned off by default, but can be turned back on if needed. Inadditiona these flags have been extended to the
generate_json_schemafunction and CLI tool.