-
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
Fix handling of allowed-values enumeration in JSON Schemas #253
Fix handling of allowed-values enumeration in JSON Schemas #253
Conversation
28872af
to
21383fb
Compare
fd1d180
to
6446c73
Compare
6446c73
to
71233f4
Compare
@wendellpiez let me know how you feel about the cleaned up tests and how we ought to handle ongoing considerations, in the code to resolve this issue or elsewhere. Should we do a walk-through review to discuss changes and improvements (like the overlapping |
de0a6bd
to
f9eccbe
Compare
@david-waltermire-nist and @wendellpiez, this is ready for re-review. |
test-suite/metaschema-xspec/json-schema-gen/json-value-testing-mini-metaschema-COMPOSED.xml
Outdated
Show resolved
Hide resolved
bc5bafc
to
a1f1e47
Compare
36d62ed
to
40f1291
Compare
There does seem to be weirdness with how using the <!-- return-compose-metaschema.xsl file -->
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:math="http://www.w3.org/2005/xpath-functions/math" exclude-result-prefixes="xs math"
xmlns:nm="http://csrc.nist.gov/ns/metaschema"
version="3.0" xmlns="http://www.w3.org/2005/xpath-functions"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/metaschema/1.0" expand-text="true">
<!-- Purpose: Produce an XPath-JSON document representing JSON Schema declarations from Metaschema source data.
The results are conformant to the rules for the XPath 3.1 definition of an XML format capable of being cast
(using the xml-to-json() function) into JSON. -->
<!-- Note: this XSLT will only be used on its own for development and debugging.
It is however imported by `produce-json-converter.xsl` and possibly other stylesheets. -->
<xsl:strip-space elements="METASCHEMA define-assembly define-field model"/>
<xsl:output indent="yes" method="xml"/>
<xsl:import href="../nist-metaschema-COMPOSE.xsl"/>
<xsl:template match="/">
<xsl:sequence select="nm:compose-metaschema(/)"/>
</xsl:template>
</xsl:stylesheet>
This has left me scratching my head. Wendell believes, and there is a good chance, this difference has something to do with how XSpec builds context to make unit testing possible even with |
6dc496b
to
31093a8
Compare
Touched up a rebase for now to come back to this in the evening or tomorrow morning. |
@wendellpiez recommended this morning an alternate approach and just using the shell (aka |
b382853
to
b6e5f89
Compare
I need to clean up base (weirdly Hat tip @liamquin, @martin-honnen, and of course @wendellpiez for helping me getting through what should have been an easy refactor. |
b6e5f89
to
3b65cc1
Compare
3b65cc1
to
09c4afb
Compare
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.
The test vectors look good to me. I cannot weigh in on the XSLT. I'll rely on the review from @wendellpiez for that.
The shift in test approach, with the shell entrypoint at ist-metaschema-MAKE-JSON-SCHEMA.xsl and not with the previous make-json-schema-metamap.xsl replaced means that parameter, which was not working particularly well in the previous approach.
3d628ac
to
15b3b6d
Compare
OK, @david-waltermire-nist and @wendellpiez I rebased to be clean against recent Please let me know if you need anything for finalizing a review and rolling this into |
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.
Looking good - so far!
…bmodule-20230131 [WIP] Test out usnistgov/metaschema#253 fix for usnistgov/metaschema#…
* Fix JSON Schema generation for #240 and add tests. * Adapt test suite approach per PR feedback. * Final cleanup of unused parameter. The shift in test approach, with the shell entrypoint at ist-metaschema-MAKE-JSON-SCHEMA.xsl and not with the previous make-json-schema-metamap.xsl replaced means that parameter, which was not working particularly well in the previous approach.
Committer Notes
Closes #240.
To not clutter PR, sample JSON schema resulting from this change after update from previous PR review:
https://gist.github.com/aj-stein-nist/17c21528df4c12a33a49aff665b6e8e8/
All Submissions:
Changes to Core Features:
Have you updated all website](https://pages.nist.gov/metaschema) and readme documentation affected by the changes you made? Changes to the website can be made in the website/content directory of your branch.