-
Notifications
You must be signed in to change notification settings - Fork 10
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
Addressing "items" keyword in "type" : "array" declarations. #100
Comments
Hello, you may check if a |
Thank you so much for replying so quickly! I'll try this out. I was concerned because it doesn't show up when I walk the getSubschemas() and getPropertySubschemas() objects. If I start at the top CompositeSchema, I should encounter the property whose TypeSchema is "array". Can you suggest a way to navigate to "items" from there? Thanks again. fieldName:anArray; class:com.github.erosb.jsonsKema.CompositeSchema How do I get to "Items". Please ignore this followup question if the answer is documented. Thanks much!!!! |
(typo: I mean getPropertySchemas() -- sorry) |
Any subschemas inside a CompositeSchema correspond to a single schema keyword. So if you have a json schema like {
"type": "array",
"items": {
"type": "string"
}
} Then it will be parsed into a
(Hope this kotlin notation is readable enough) |
Thank you again for working with me on this. I want to use this library. Whenever I iterate through the CompositeSchema's subschemas and propertySchemas, the ItemSchema doesn't show up. For example:
No ItemSchema appears in the subschemas() of CompositeSchema("anArray") Thanks for your help!!!! |
Please try with |
Oh man! It works, beautifully!!!! Thank you so much!!! I am so grateful! Apologies for troubling you with what essentially was a syntax error. Is there any way I can "buy you a coffee" ? |
Haha, there is a green "Donate" button on the predecessor project: https://github.com/everit-org/json-schema |
There does not seem to be a way to programatically access the contents of the "items" keyword. Apologies if the method for doing this is documented elsewhere.
I am working on a project that involves translating different schemas (e.g. AVRO, JSONSchema) to an internal format. To do so I need to "walk" the schema. json-sKema seemed like the right tool to do that, but I am unable to "see" the "items" tag that comes as part of an "array" declaration.
Thanks for any help.
The text was updated successfully, but these errors were encountered: