Skip to content

Commit

Permalink
Align schema ref and id fields (usnistgov#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitawootten-nist authored Jan 19, 2024
1 parent f2358df commit a36144f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/schema-gen/JSON-schema/make-json-schema-metamap.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<map key="json-schema-directive">
<string key="title">Schema Directive</string>
<string key="description">A JSON Schema directive to bind a specific schema to its document instance.</string>
<string key="$id">#json-schema-directive</string>
<string key="$id">#/definitions/json-schema-directive</string>
<string key="$ref">#/definitions/URIReferenceDatatype</string>
</map>
<xsl:apply-templates select="define-assembly | define-field"/>
Expand Down Expand Up @@ -94,7 +94,7 @@
<xsl:template match="define-assembly" mode="root-requirement">
<map key="properties">
<map key="$schema">
<string key="$ref">#json-schema-directive</string>
<string key="$ref">#/definitions/json-schema-directive</string>
</map>
<map key="{root-name}">
<xsl:apply-templates select="." mode="make-ref"/>
Expand Down Expand Up @@ -123,15 +123,15 @@
</string>
</xsl:if>
</xsl:template>

<xsl:template match="*" mode="make-ref">
<string key="$ref">
<xsl:apply-templates mode="make-definition-id" select="."/>
</string>
</xsl:template>

<xsl:template match="*" mode="make-definition-id">
<xsl:text expand-text="true">#{ substring(replace(@_metaschema-json-id,'/','_'),2) }</xsl:text>
<xsl:text expand-text="true">#/definitions/{ $composed-metaschema/*/short-name }-{@_key-name}</xsl:text>
</xsl:template>

<xsl:template priority="100" match="METASCHEMA/define-assembly">
Expand Down

0 comments on commit a36144f

Please sign in to comment.