-
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
Consistent format usage in json schemas #434
Comments
It looks like "uuid" was added in JSON Schema Draft 2019-09, which is one newer than DRAFT 07. Since only DRAFT 07 is widely adopted, using the "uuid" format is problematic if it will cause errors in tools. I poked around and couldn't find the specification reference for "byte". It doesn't look like it is supported in DRAFT 07 either. Given this information, we may want to delay addressing this issue until we are ready to move beyond DRAFT 07. |
Given this is an issue pertaining to how Metaschema serializes its types into JSON Schemas during schema generation and not specific to OSCAL: @david-waltermire-nist, are we ok to transfer this issue to the usnistgov/metaschema repo? |
I looked into this quite a bit more. Metaschema provides 4 date-related data types: The In JSON schema the The As a result, the following is true about the Metaschema date data types.
In OSCAL For other types the following was considered.
I don't see Given all of this, it looks like OSCAL is fine. We may want to consider either:
It looks like JSON schema to 2019-09 has greater adoption now. Option 1 might be a good move. Thoughts? |
usnistgov/OSCAL#837 (comment) was really my summary of my mistaken impression of this issue based on the last update, @david-waltermire-nist. From what I am understanding here, the OSCAL JSON Schemas are generated by metaschema-xslt, based upon alignment with the metaschema specification. Should I not transfer this to metaschema or metaschema-xslt depending on whether the spec will dictate this or the XSLT and Java implementations need to align on this as an implementation detail? |
I am in support of "Option 3" (Option 1 + Option 2) and evaluate supporting Draft 07 and Draft 2019-09 JSON Schema variants in tandem and aligning with duration support being in the latter. Dave will evaluate with WIP test code and we assess at a later date. |
Solid work on the analysis @david-waltermire-nist |
User Story:
As an OSCAL application engineer, I would like consistency in the format parameter in the JSON schemas.
Goals:
In some cases, for instance ("date-authorized" in Leveraged Authentications)
Schema definitions use a regex instead of the format parameter for "date" or "date-time"
While in other definitions format: "date-time" is used.
For consistency adding a format parameter in addition to the regex gives additional flexibility for application & API development.
Dependencies:
Other instances of definitions that have an unused matching format parameter: "byte" for base64
OpenApi does suggest using a "uuid" format for uuid's although it's not part of the draft, swagger will have an easier time understanding that uuid's are uuids.
Acceptance Criteria
The text was updated successfully, but these errors were encountered: