-
Notifications
You must be signed in to change notification settings - Fork 706
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
Use more json schema annotations in the basic form #5532
Conversation
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com> Conflicts: dashboard/src/shared/schema.ts
</div> | ||
</> | ||
</div> | ||
); | ||
} | ||
|
||
export function renderConfigType(value: IBasicFormParam) { | ||
return renderCellWithTooltip(value, "type", "italics"); | ||
const stringType = | ||
value?.type === "array" ? `${value?.type}<${value?.items?.type}>` : value?.type; |
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.
value?.type === "array" ? `${value?.type}<${value?.items?.type}>` : value?.type; | |
value?.type === "array" ? `array of ${value?.items?.type}` : value?.type; |
Minor suggestion, as it is for human reading.
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.
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.
LGTM
Description of the change
As pointed out by @jl-beast at #5512, we could leverage more JSON Schema built-in annotations to enrich the UX.
This PR (and the stacked ones) is adding support for
examples
,readOnly
,deprecated
,maxItems
,multipleOf
amongst others (following http://json-schema.org/draft/2020-12/json-schema-validation.html#name-a-vocabulary-for-structural)Benefits
Richer UX in the basic form for complex schemas
Possible drawbacks
N/A
Applicable issues
Additional information