-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Support JSON Schema 2019-09 deprecated value #156
Comments
Would you like to send a Pull Request to address this feature? Remember to add unit tests. |
the actual syntax: |
I tried to address it on #161 but I'm not sure about handling this property inheritance. Should array properties with a single schema item inherit 'deprecated' property? Which one should resolve? expect(
S.object()
.prop('foo', S.string())
.prop('bar', S
.array()
.items(S.number().deprecated())
)
.valueOf()
).toEqual({
$schema: 'http://json-schema.org/draft-07/schema#',
type: 'object',
properties: {
foo: { type: 'string' },
bar: {
type: 'array',
deprecated: true,
items: { type: 'number' }
}
},
})
expect(
S.object()
.prop('foo', S.string())
.prop('bar', S
.array()
.items(S.number().deprecated())
)
.valueOf()
).toEqual({
$schema: 'http://json-schema.org/draft-07/schema#',
type: 'object',
properties: {
foo: { type: 'string' },
bar: {
type: 'array',
items: { type: 'number', deprecated: true, }
}
},
}) Is the same valid for single property objects? |
I think the latter is right and the former is not: |
Prerequisites
🚀 Feature Proposal
Add support to deprecated values as stated in the JSON Schema 2019-09 paragraph.
Motivation
Be able to deprecate properties without
raw()
.Example
Current workaround:
The text was updated successfully, but these errors were encountered: