-
Notifications
You must be signed in to change notification settings - Fork 12
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
How to create a heterogeneous array of allOf? #137
Comments
Just to illustrate I thought maybe something like this would work but it's not a valid JSON: "allOf":[
+ "enum": [
+ { "$ref": "#/definitions/foo" },
+ { "$ref": "#/definitions/bar" }
+ ]
] |
Okay I got the schema:
and it validates to:
now I'm concerned with how to make it "schemasafe".
How can I restrict |
I tried to use the
but this doesn't match my output
and I get the error 🛑
|
This type of schema also does not work against the required JSON.
How can I match the type requirement? |
I think I've finally got the hang of it. This would be an example using the
However I'm feel like I'm still lacking the full understanding to produce an idiomatic formula for representing a heterogeneous collection of either Foo or Bar objects. There seems to be many ways of representing such a collection but I'd like it to be 'schemasafe'. |
I've got an answer to the issue elsewhere. |
I'm trying to figure out a way to represent an array of enum.
Could you point me to an example?
I tried to verify
against my schema
with JSON Schema Lint, but I get an error 🛑
The text was updated successfully, but these errors were encountered: