finos / finos/architecture-as-code

Add spectral rule to ensure oneOf nodes are referenced from oneOf relationships

Open
#1,228 0 comments 0 reactions 0 assignees View on GitHub
cli
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.