You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the implementation of the discussion
#1451
and a follow-up on #1441.
The PR adds schema validation to Sphinx-Needs that
supports local validation and network validation.
The Sphinx-Needs internal data type representation is not changed yet,
all types are still strings. This will come shortly after merge.
Users can already try out the new interface and provide feedback.
Differences to PR 1441:
- Aligning with standards in JSON schema for re-using subschemas via
`$defs` and `$ref`
- Fully typed implementation including runtime checks of valid schema
user input
- Auto inject the default string type if not given
- Replace `trigger_schema` with `select` which aligns with query
language terminology
- Replace `trigger_schema_id` with the mentioned `$ref` mechanism
- New schemas root key `validate` with sub-keys `local` and `network`
for the 2 validation types
- Network validation items does not allow the `select` key anymore as
the selection happens by linking target needs.
This cleans up an ambiguity in the other PR.
- Network validation errors now bubble up to the root json schema and
are displayed to see exactly why the chain fails
- More network rule types for better control over debug schema output
- Rewrite test cases to use a declarative definition as yaml, so all
pieces can be given in one place:
- conf.py
- ubproject.toml
- index.rst
- schemas.json
- expected ontology warnings
- Simplified the code logic
- String patterns (regex) are constrained to a basic subset that works
across engines
- Added docs
- Examples and explanations
- Comparison with `needs_warnings` and `needs_constraints` and migration
path
- Many more test cases
- `items` with `minItems` and `maxItems` and `contains` with
`minContains` and `maxContains` are now semantically equivalent to JSON
schema spec
---------
Co-authored-by: Chris Sewell <[email protected]>
0 commit comments