Nothing happens, unable to generate from OpenAPI JSON Schema
See original GitHub issueI am trying to leverage the OpenAPI JSON Schema, to validate some user provided OpenAPI definitions. When trying to use the maven-plugin or the jsonschema2pojo website, I get no results.
JSON Schema: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>1.1.2</version>
<configuration>
<sourceType>jsonschema</sourceType>
<sourceDirectory>${basedir}/src/main/resources/schemas</sourceDirectory>
<targetPackage>com.example.openapi</targetPackage>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
[BUG] [Online Generator] silently fails and seemingly does ...
Go to the online generator (stable or master, same on both) · Upload any valid json spec ...
Read more >What does the "Unrecognized token openapi" error mean ...
I'm currently working on openapi-generator-maven-plugin to generate Java classes from an OpenAPI JSON schema. The errors looks like a syntax problem.
Read more >OpenAPI and JSON Schema: When to Use Which
As an API architect who wants to follow this quick fix, this means that a pure JSON Schema draft will be your Rosetta...
Read more >openapi-typescript - npm
Convert static OpenAPI schemas to TypeScript types quickly using pure Node.js. Fast, lightweight, (almost) dependency-free, and no Java/node- ...
Read more >Solving OpenAPI and JSON Schema Divergence - Medium
Step 1: Converting OpenAPI to JSON Schema · Strip $schema and id from root, which are both invalid keywords in OpenAPI · Switches...
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 Free
Top 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
Yes, this has been changed since version 2019-09. Versions below (e.g. draft-0[1-7]) has this explicit restriction
It’s possible to have a JSON schema with no meaningful rules or types to generate. This means the plugin has done its work but there is nothing to do.
Until recent versions, the JSON schema spec explicitly mentioned that the presence of
$ref
in a schema should mean that all other keys in the schema must be ignored. So this is what jsonschema2pojo does. I believe that this may have changed in recent versions of the JSON schema spec, however we should find an explicit reference.