question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to generate models for meta jsonschema

See original GitHub issue

Describe the bug I expected to be able to generate Pydanic models for validating JSONSchemas themselves.

To Reproduce Fetch the json-schema meta-schema draft 7:

wget http://json-schema.org/draft-07/schema

Run datamodel-codegen:

datamodel-codegen --input schema --input-file-type jsonschema

Expected behavior I expected data-models able to parse JSONSchemas to be generated.

Version:

  • OS: [e.g. iOS] Ubuntu 20.04.2 LTS
  • Python version: Python 3.8.5
  • datamodel-code-generator version: [e.g. 22] 0.11.7

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
koxudaxicommented, Jun 11, 2021

@Skeen Thank you for creating this issue. I have confirmed the error. But, I don’t understand why the error occurs. I will check it.

1reaction
Skeencommented, Aug 21, 2021
        "examples": {
            "type": "array",
            "items": true
        },

I don’t understand why items have true. I expect a list of the object.

What do you think about it?

This is unexpected to me too, I’d have imagined either a type definition or a reference within an object, not just true.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failing to parse open-rpc's meta-schema · Issue #593 - GitHub
https://meta.open-rpc.org/. Now in order to parse files based on this meta-schema one would like to generate data model for it.
Read more >
Implementations - JSON Schema
This meta model can be used in Mako templates to generate source code, other schemas or plantUml. statham (MIT) - generate type-annotated models...
Read more >
Validating a json with the json schema validator throws an ...
Spring Boot json schema validation with version draft 07 throws JsonSchemaException: Unknown MetaSchema: https://json-schema.org/draft-07/ ...
Read more >
After recent update json schema validation fails - Airbyte
I have created a source connector based on source-github connector. Specifically, I am reusing schema files. Everything has been working just ...
Read more >
draft-handrews-json-schema-validation-02 - IETF Datatracker
JSON Schema Validation: A Vocabulary for Structural Validation of JSON ... and to make assertions about what a valid document must look like....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found