Skip to content

fix(schema): add missing definitions (ReferenceIdentifier, IdentifiableIdentifier, ReferableIdentifier, FragmentIdentifier, DescriptorIdentifier)#71

Open
aorzelskiGH wants to merge 1 commit into
IDTA-01004-3-1_Workingfrom
fix/schema-missing-refs
Open

fix(schema): add missing definitions (ReferenceIdentifier, IdentifiableIdentifier, ReferableIdentifier, FragmentIdentifier, DescriptorIdentifier)#71
aorzelskiGH wants to merge 1 commit into
IDTA-01004-3-1_Workingfrom
fix/schema-missing-refs

Conversation

@aorzelskiGH
Copy link
Copy Markdown
Contributor

Summary

Adds the five JSON Schema definitions that the access rule schemas
reference via $ref but never actually declare. Without them the
schemas are formally invalid under draft-07 and every standard
validator (AJV, jsonschema, etc.) fails before it can even look at
rule content.

Affected definitions:

  • ReferenceIdentifier (used by attributeItem.REFERENCE)
  • IdentifiableIdentifier (used by objectItem.IDENTIFIABLE)
  • ReferableIdentifier (used by objectItem.REFERABLE)
  • FragmentIdentifier (used by objectItem.FRAGMENT)
  • DescriptorIdentifier (used by objectItem.DESCRIPTOR)

Affected files:

  • documentation/IDTA-01004/modules/ROOT/partials/json/aas-queries-and-access-rules-schema.json
  • documentation/IDTA-01004/modules/ROOT/partials/json/access-rule-model.json

Each definition is a typed string with a pattern derived from the
corresponding production in the authoritative BNF
(partials/bnf/access-rules.bnf): RouteObject, IdentifiableObject,
ReferableObject, FragmentObject, DescriptorObject, and
ReferenceAttribute.

Problem

The schemas were unusable end-to-end. Any attempt to validate an
access rule document against these schemas errored out during
resolution of $ref: "#/definitions/IdentifiableIdentifier" (and the
four other targets).

Solution

Declare the missing definitions with string patterns that match the
BNF surface syntax, e.g.:

  • IdentifiableIdentifier: ^\$(?:aas|sm|cd)\((?:"\*"|"[^"]*")\)$
  • ReferableIdentifier: ^\$sme\((?:"\*"|"[^"]*")\)\.[^\s]+$
  • DescriptorIdentifier: ^\$(?:aasdesc|smdesc)\((?:"\*"|"[^"]*")\)$
  • ReferenceIdentifier: $aas|$sm|$cd|$sme forms with #<Fields...>

FragmentIdentifier is kept as a plain string because
<FragmentLiteral> is deliberately opaque in the BNF.

Impact

  • Affected specs: IDTA-01004 (aas-specs-security)
  • No behavioural change for valid rules — only broken schemas are
    now valid.
  • Enables CI-side JSON Schema validation (follow-up in T-12 / T-16).

Review notes

  • Please confirm the patterns for IdentifiableIdentifier and
    ReferenceIdentifier are sufficient; we intentionally kept them
    permissive (no deep nesting of $sme path) to avoid false
    negatives in existing examples.
  • FragmentIdentifier is intentionally under-constrained; we
    recommend tightening it together with a future normative
    specification of <FragmentLiteral>.

Related

Review Finding T-04: JSON Schema referenced but not declared.

The access rule JSON schemas referenced five definitions that were not
actually declared anywhere in the schema files, making the schemas
formally invalid for any standard validator:
  - ReferenceIdentifier
  - IdentifiableIdentifier
  - ReferableIdentifier
  - FragmentIdentifier
  - DescriptorIdentifier

These definitions are now added to both
  partials/json/aas-queries-and-access-rules-schema.json
  partials/json/access-rule-model.json

Each definition is a typed string with a pattern derived from the
corresponding production in the Access Rules BNF (RouteObject,
IdentifiableObject, ReferableObject, FragmentObject, DescriptorObject,
ReferenceAttribute).

No changes to the public JSON format for valid rules; previously any
validator would error out before reaching rule content.

Refs: Review Finding T-04
Made-with: Cursor
},
"DescriptorIdentifier": {
"type": "string",
"description": "Identifier for a Descriptor (AAS Descriptor, Submodel Descriptor) as used in OBJECTS DESCRIPTOR. Format: $aasdesc(\"...\") | $smdesc(\"...\") | same with wildcard \"*\".",
},
"DescriptorIdentifier": {
"type": "string",
"description": "Identifier for a Descriptor (AAS Descriptor, Submodel Descriptor) as used in OBJECTS DESCRIPTOR. Format: $aasdesc(\"...\") | $smdesc(\"...\") | same with wildcard \"*\".",
},
"DescriptorIdentifier": {
"type": "string",
"description": "Identifier for a Descriptor (AAS Descriptor, Submodel Descriptor) as used in OBJECTS DESCRIPTOR. Format: $aasdesc(\"...\") | $smdesc(\"...\") | same with wildcard \"*\".",
},
"DescriptorIdentifier": {
"type": "string",
"description": "Identifier for a Descriptor (AAS Descriptor, Submodel Descriptor) as used in OBJECTS DESCRIPTOR. Format: $aasdesc(\"...\") | $smdesc(\"...\") | same with wildcard \"*\".",
"DescriptorIdentifier": {
"type": "string",
"description": "Identifier for a Descriptor (AAS Descriptor, Submodel Descriptor) as used in OBJECTS DESCRIPTOR. Format: $aasdesc(\"...\") | $smdesc(\"...\") | same with wildcard \"*\".",
"pattern": "^\\$(?:aasdesc|smdesc)\\((?:\"\\*\"|\"[^\"]*\")\\)$"
"DescriptorIdentifier": {
"type": "string",
"description": "Identifier for a Descriptor (AAS Descriptor, Submodel Descriptor) as used in OBJECTS DESCRIPTOR. Format: $aasdesc(\"...\") | $smdesc(\"...\") | same with wildcard \"*\".",
"pattern": "^\\$(?:aasdesc|smdesc)\\((?:\"\\*\"|\"[^\"]*\")\\)$"
Copy link
Copy Markdown
Collaborator

@Martin187187 Martin187187 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice find.

@Martin187187
Copy link
Copy Markdown
Collaborator

this pr is critical.
todo for me:

  • check json schema in validator if compiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants