finos / finos/architecture-as-code
Add spectral rule to ensure oneOf nodes are referenced from oneOf relationships
- Dominant language
- TypeScript
- Stars
- 399
- Forks
- 138
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 37
Description
## Feature Proposal
### Target Project:
calm validate on CLI
### Description of Feature:
Now we have optional features with oneOf/anyOf, there is an issue: you can reference a node within a oneOf/optional block from a concrete/fixed relationship. In other words we don't correctly validate the optionality - options are 'viral' in that anything referencing an optional property needs to also be optional.
We should validate this with a Spectral rule.
Contributor guide
Research direction
Start with the calm validate CLI entry point and its existing Spectral rules. Trace how oneOf and anyOf optional nodes and relationships are represented, then define the validation behavior for references from fixed relationships. Done means the rule rejects invalid optionality and accepts valid oneOf relationships, with tests covering both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100