oxidecomputer / oxidecomputer/typify
handling of `not` is incorrect in the general case
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 898
- Forks
- 114
- Avg merge
- 4h 18m
- Merged PRs (30d)
- 14
Description
Currently we don't properly handle the general case of not. We do (pretty much) properly address cases such as this:
{
"allOf": [
{ "$ref": "#/$defs/foo" },
{
"not": {
"required": [ "bar" ]
}
}
]
}
However, we don't handle
{
"allOf": [
{ "$ref": "#/$defs/foo" },
{
"not": {
"required": [ "bar", "baz" ]
}
}
]
}
We also don't handle properties in the not schema.
We can think of the various components of a not schema as independent constraints. So if a not schema contains independent constraints X, Y, and Z, we could rewrite that as not: allOf: [X, Y Z]. Then we can transform that into anyOf: [ not: X, not: Y, not: Z]. While we don't currently properly handle anyOf (see #414), once we do, that will turn into a oneOf power set of those.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by reviewing the existing handling of not and the related anyOf work in issue #414. Done means supporting multi-constraint and property-containing not schemas, with behavior matching the transformations described in this issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100