fix(bnf,schema): align idShort with Metamodel Constraint AASd-002#580
Open
aorzelskiGH wants to merge 1 commit intoIDTA-01002-3-2_workingfrom
Open
fix(bnf,schema): align idShort with Metamodel Constraint AASd-002#580aorzelskiGH wants to merge 1 commit intoIDTA-01002-3-2_workingfrom
aorzelskiGH wants to merge 1 commit intoIDTA-01002-3-2_workingfrom
Conversation
IDTA-01001 Constraint AASd-002 normatively defines idShort as: ^[a-zA-Z][a-zA-Z0-9_-]*[a-zA-Z0-9_]+$ i.e. at least two characters, starting with a letter, not ending with a hyphen. The BNF productions in grammar.bnf/access-rules.bnf and the idShort-path regex in query-json-schema.json, schema.adoc and openapi.yaml marked the trailing character group optional, so single- character idShorts (e.g. "A") and trailing-hyphen idShorts (e.g. "Ab-") were accepted. Changes: BNF (<idShort>): before: ( L (( L | D | "_" | "-" )* ( L | D | "_" ) )? ) after: ( L ( L | D | "_" | "-" )* ( L | D | "_" ) ) (L = letter, D = digit) JSON-Schema / OpenAPI regex: before: [A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])? after: [A-Za-z][A-Za-z0-9_-]*[A-Za-z0-9_] Equivalent to AASd-002 (min 2 chars, cannot end with hyphen). Refs: Review Finding T-06 Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the
idShortgrammar and regex used by this spec with thenormative definition in IDTA-01001 Constraint AASd-002:
Problem
Both the BNF and the JSON Schema / OpenAPI regex marked the trailing
character group optional:
<idShort>):( L (( L | D | "_" | "-" )* ( L | D | "_" ))? )[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?That allowed single-character idShorts (e.g.
A) and, through the*+ optional group, idShorts whose trailing character group wassimply absent — both of which AASd-002 forbids.
Solution
Make the trailing character group mandatory so there is always at
least one "non-hyphen" character after the initial letter:
( L ( L | D | "_" | "-" )* ( L | D | "_" ) )[A-Za-z][A-Za-z0-9_-]*[A-Za-z0-9_]Equivalent to AASd-002. Minimum length is now 2; a trailing hyphen
is disallowed.
Files touched (per repo):
documentation/IDTA-01002-3/modules/ROOT/partials/bnf/grammar.bnfdocumentation/IDTA-01002-3/modules/ROOT/partials/query-json-schema.jsondocumentation/IDTA-01002-3/modules/ROOT/pages/schema.adocPart2-API-Schemas/openapi.yamldocumentation/IDTA-01004/modules/ROOT/partials/bnf/access-rules.bnfdocumentation/IDTA-01004/modules/ROOT/partials/json/aas-queries-and-access-rules-schema.jsondocumentation/IDTA-01004/modules/ROOT/partials/json/formulas-and-logical-expressions.jsonImpact
valid under AASd-002 remains valid here.
always disallowed by AASd-002 but accepted by this spec — are now
rejected, matching the Metamodel spec.
Review notes
trailing-hyphen idShorts. A quick scan of
partials/examples/found none.
change; both should land together.
Related
Review Finding T-06: idShort regex inconsistent with AASd-002.