[V3.1.3 Backport] fix(bnf,schema): align idShort with Metamodel Constraint AASd-002#611
Open
sebbader-sap wants to merge 2 commits into
Open
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.
Backport from PR #580
This is a backport of the bugfix from PR #580 to the V3.1.3 release branch.
Original PR Description
This PR corrects the grammar and schema definitions for
idShortto match IDTA-01001 Constraint AASd-002. The constraint requires that idShort contain "at least two characters and shall only feature letters, digits, hyphen and underscore; starting mandatory with a letter, and not ending with a hyphen."Problem: Both the BNF grammar and JSON Schema regex previously made the trailing character group optional, allowing single-character identifiers and those ending with hyphens—both violations of the normative constraint.
Solution: Make the trailing character group mandatory:
( L ( L | D | "_" | "-" )* ( L | D | "_" ) )[A-Za-z][A-Za-z0-9_-]*[A-Za-z0-9_]Changes
Related