Skip to content
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

CALM meta-schema use of 'required' is incorrect according to JSON schema standard #75

Closed
willosborne opened this issue Mar 22, 2024 · 1 comment
Assignees

Comments

@willosborne
Copy link
Member

Bug Report

The CALM meta-schema specifies 'nodes' and 'relationships' as top-level required fields here:

https://github.com/finos-labs/architecture-as-code/blob/main/calm/draft/2024-03/meta/core.json#L18

There are two issues with this:

  • It is specified inside the list of properties, instead of outside the list.
  • Specifying it outside the list does not have the intended effect.

In JSON meta-schema it does not appear to be possible to mandate that all schemas have a top-level property set.
If the required block was to be moved out of the properties list - in order to make the schema syntactically correct per the first issue - what this configuration does currently is specify that all objects defined must have nodes and relationships set on them

In other words, this applies to objects one level down in the schema, rather than the top-level objects as intended.
This means that code generation and validation gets confused, and reports that 'nodes' is missing on inner objects. It also generates extra nodes/relationships properties that should not be present.

Intended fix

Remove the required nodes/relationships section.
This will instead be enforced by Spectral validation rules.

@rocketstack-matt
Copy link
Member

This issue is resolved, addition of Spectral rules for pattern validation that the nodes and relationships are present will be tracked in #95

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

No branches or pull requests

3 participants