Skip to content
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

Render valid value restrictions in tables based on object definitions in schema #912

Closed
tsalo opened this issue Oct 27, 2021 · 0 comments · Fixed by #921
Closed

Render valid value restrictions in tables based on object definitions in schema #912

tsalo opened this issue Oct 27, 2021 · 0 comments · Fixed by #921
Labels
enhancement New feature or request schema Issues related to the YAML schema representation of the specification. Patch version release.

Comments

@tsalo
Copy link
Member

tsalo commented Oct 27, 2021

It would be great if tables in the specification automatically included restrictions on valid values, without having to hardcode those restrictions in the object "description" fields.

This stems from #827 (comment).

As a simple example, we can look at the CASLType metadata field:

CASLType:
name: CASLType
description: |
Describes if a separate coil is used for labeling:
`"single-coil"` or `"double-coil"`.
type: string
enum:
- single-coil
- double-coil

Note that there are currently two valid values for this field: "single-coil" and "double-coil". These values are written out in two places: (1) the "enum" that actually restricts valid values for the field and (2) the "description", which redundantly includes the values. Optimally, we wouldn't need to include a list of valid values in the description, since that information is already available, in a more useful form, elsewhere in the object definition. One step in this direction is to update our table-rendering functions to attempt to convert restrictions on valid values to a human-readable form and append that new string to the "description" cell in the table automatically.

NOTE: Preferably, any enhancements to the code to implement this would also work with #904.

@tsalo tsalo added enhancement New feature or request schema Issues related to the YAML schema representation of the specification. Patch version release. labels Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request schema Issues related to the YAML schema representation of the specification. Patch version release.
Projects
None yet
1 participant