Replies: 1 comment 27 replies
-
There's not a solution for draft 7, but if you can update to draft 2020-12, you'll get the The benefit of So You can try this at https://json-everything.net/json-schema. This passes {
"test": [
{
"foo": "ad",
"baz": false
}
]
} This fails {
"test": [
{
"foo": "ad",
"bar": "a string",
"baz": false
}
]
} |
Beta Was this translation helpful? Give feedback.
27 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I bet this is a common question but I wasn't able to figure out exactly what I was hoping for. I'm trying to "extend" a defined "type" (something in "$defs") with some other properties:
The idea here is to extend
myDefinition
, which has a single propertybaz
, with propertiesfoo
andbar
(eitherfoo
orbar
is required, andbaz
is optional). In this case, these would be valid.The
"allOf": [{ "$ref": "#/$defs/myDefinition" }],
is from https://stackoverflow.com/a/52579526/17378715, not sure how I should get this to work.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions