-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add documentation re well-formedness and validation. #1169
Add documentation re well-formedness and validation. #1169
Conversation
There are multiple failure scenarios for OSCAL documents, and JSON, XML, and YAML more generally: | ||
|
||
1. The document is well-formed, but is not conformant to the schema and errors are correctly reported. | ||
2. The document is not well-formed, so validation cannot occur. |
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.
Minor observation: lack of well-formed precludes schema validation, so well-formedness should precede schema validation.
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.
Don't we cover that later in the document?
What OSCAL tools help you check well-formedness?
NIST's OSCAL tools do not explicitly check that JSON, XML, or YAML is well-formed. If you are a tool developer, we expect you to use your language runtime and libraries to parse JSON, XML, and YAML and check for the well-formed data. This must occur before validating an OSCAL document. (Emphasis add here by me for context.)
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.
Well-formedness is logically prior but not temporally prior; indeed a big reason for grammar-based validation is that it can be performed at (concurrently with) the parse. To parse and then to validate is one way to do it; but there is nothing wrong with attempting validation and seeing what happens in the parse.
Suggest a little tweakage. In a runtime or in a workflow generally, validation may occur early and often, or only at system boundaries. What we are defining here is not how to validate, but what constitutes conformance ("valid to X schema"). We do not define XML, JSON or validation; only the OSCAL schemas.
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 can see your point, but I do not say whether it is logically or temporally before (if we are addressing the snippet where I copied from).
What do you recommend we add or take away?
I only added this bit to address the question in the section header: Q: What OSCAL tools [from NIST] check well-formedness? A: NIST's OSCAL tools do not provide tools to check well-formedness, because if you are a tool developer it is on you to check that before (logically or temporally) using schemas to validate. [This implies: do not report issues back to NIST with problems in schema validation when it is easy to spot the document isn't well-formed. These are not schema issues, it should be obvious but you ought to check the doc is well-formed somewhere in your code.]
So, how can we write that better?
Looks like there is one bad link that is causing the build to fail:
|
659dacf
to
f9f53d0
Compare
OK, @david-waltermire-nist, pulled in all your feedback and squashed all the commits. Let me know what you want to do with the last comment, that is the only thing that requires further discussion and not immediate editorial changes. |
@david-waltermire-nist and @wendellpiez, I added some content and a suggestion from Wendell around using a SVG-based Venn diagram to clarify things. Colors, orientation, size (pre-render or during layout with stylesheet), any feedback, let me know. |
Wrap in Dave's suggestions for layer index page summary. Co-authored-by: David Waltermire <david.waltermire@nist.gov> Wrap in Dave's suggestion to tweak target audience callout. Co-authored-by: David Waltermire <david.waltermire@nist.gov> Wrap in Dave's suggestion in audience callout: clarify some not all terminology. Co-authored-by: David Waltermire <david.waltermire@nist.gov> Wrap in Dave's suggestion in why are concepts important section. Co-authored-by: David Waltermire <david.waltermire@nist.gov> Wrap in Dave's clean up for wf/validity paragraph. Co-authored-by: David Waltermire <david.waltermire@nist.gov> Wrap in Dave's clean up for wf/validity definition lead-in paragraph. Co-authored-by: David Waltermire <david.waltermire@nist.gov> Wrap in Dave's cleanup for what is valid OSCAL section. Co-authored-by: David Waltermire <david.waltermire@nist.gov> Wrap in Dave's suggestion in section about OSCAL schemas. Co-authored-by: David Waltermire <david.waltermire@nist.gov> Fix path to validation page. Slash should be trailing for relative paths, prefixing is absolute, woops! More link fixup. determines->determine for plural in why concepts important section. More touchups from Wendell and AJ, after Dave's feedback. Add Venn diagram for feedback from Dave based on rec from Wendell. Add Venn diagram links for feedback from Dave based on rec from Wendell. Small touchups and excellent SVG from @wendellpiez.
a63f295
to
c975ad6
Compare
OK, now with more touchups and a much simpler and prettier SVG thanks to @wendellpiez. Demo from localhost below. |
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.
Thanks for addressing the feedback!
Added information about content well-formedness and validation to the website. Co-authored-by: David Waltermire <david.waltermire@nist.gov> Co-authored-by: Wendell Piez <wendell.piez@nist.gov> Co-authored-by: Alexander Stein <alexander.stein@nist.gov>
Added information about content well-formedness and validation to the website. Co-authored-by: David Waltermire <david.waltermire@nist.gov> Co-authored-by: Wendell Piez <wendell.piez@nist.gov> Co-authored-by: Alexander Stein <alexander.stein@nist.gov>
Added information about content well-formedness and validation to the website. Co-authored-by: David Waltermire <david.waltermire@nist.gov> Co-authored-by: Wendell Piez <wendell.piez@nist.gov> Co-authored-by: Alexander Stein <alexander.stein@nist.gov>
Committer Notes
Publish documentation re well-formedness and validation of OSCAL document instances. This implements part of #1153, but does not complete it. Additional PR to follow.
All Submissions:
Changes to Core Features: