json_schema_data_formats fail when looking up 'array'
See original GitHub issueWhen trying to convert file data.json to model.py, I get a keyerror on line 171 of jsonschema.py when the type in types is ‘array’.
To Reproduce
Example schema:
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
array — Understanding JSON Schema 2020-12 documentation
In JSON, each element in an array may be of a different type. ... Should be a string from a different set of...
Read more >Enum inside the Array is not validting in json-schema
In your schema, you have extra brackets [] around the items array type. This means that the enum is checked for the first...
Read more >Producing Data and Schemas in JSON array-of-array format.
In this article, I'll demonstrate how to produce an array-in-array JSON document, and the schema to go with it. With this, you have...
Read more >Restructuring of output formatting · Issue #973 · json-schema ...
While writing Section 10 on output, I was implementing the formatting in my library, Manatee.Json. In that library, I don't collect ...
Read more >Array type | Opis JSON Schema
An array is valid against this keyword if at least one item is valid against the schema defined by the keyword value. The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alright, will do 👍
@javierabosch Thank you for your email. I have fixed a problem which is a nested array. I released a new version as
0.5.11
But, I found other problems to generate models from your json data.
Need calling update_forward_refs for
MediaItem
after all dependency models are defined. I will fix the problem when I refactor a function referencing class which is related to the issue https://github.com/koxudaxi/datamodel-code-generator/issues/145 It means a feature is broken which is referencing class.change types of some field to
Optional
the code generator uses genson to convert Json data to JSON schema. the problem happens is ingenson
. You should change types toOptional
manually after you generate models.