Comments (7)
"Boolean" is not a valid type, use "boolean" instead."Boolean" will be treated as a customized type, and lead to creating a new java class.
from jsonschema2pojo.
The answer here probably depends on how you are referencing those other types. If you want to refer to something on the classpath, you can use "existingJavaType"
to refer to an existing class, so that nothing new is generated. Does that help?
from jsonschema2pojo.
@joelittlejohn
For example in the jsonschema the reference looks like this "person" : { "$ref" : "external_jsongen.json#/definitions/Person" }.
@abramsz
The custum Boolean is needed for my app to work, there are more complex types too.
from jsonschema2pojo.
I've tried some solutions manually, and all it needs is to add include of the java classes for Example 'include com.example.external_module.Person'.
from jsonschema2pojo.
Are you able to edit the schema like this:
{ "existingJavaType" : "com.example.external_module.Person" }
?
from jsonschema2pojo.
@joelittlejohn
Thanks for the response. It works, that is true, but its not the best solution and it will be a lot of work to rewrite my code to support this.
I also still need to have the external.json in the same directory. Is there a work around that?
from jsonschema2pojo.
I've encountred another problem. The solution u mentioned above works for non basic types (enums ...), but if I have "$ref" : "external.json#/definitions/myString" reference to string or int for example, it does not work, because the basic types aren't generated into java classes. Is there some solution for that?
from jsonschema2pojo.
Related Issues (20)
- Trying to make Custom annotations work (unsuccessfully) using jsonschema2pojo directly from code (embedded) using jsonschema2pojo-core. Is that doable? HOT 2
- [Wiki] [Broken-Link] Link to address.schema.json is busted
- Wiki Reference page broken? HOT 3
- Empty <p> tag
- Missing @param and @return tags for getter and setter methods
- How to create a simple pojo class with map attribute, not able to find any example. HOT 3
- Unable to generate javax.validation.constraints.DecimalMin and DecimalMax for type number HOT 2
- versie 1.2.1: setting <useJakartaValidation>true</useJakartaValidation> stil generates import javax.annotation.Generated; HOT 1
- Unable to generate from schema due to "Path not present" HOT 5
- Add canonical setter for additionalProperties
- Task 'generateJsonSchema2Pojo' fails after upgrading to Android Gradle Plugin 8.2.2 / Gradle 8.2 HOT 4
- Builder methods return type is missing generics typed
- Multiple jsonschema to individual packages
- Can't get fileFilter working with gradle plugin HOT 2
- cli option --datetime-class 'java.sql.Time' does not work . defaults to string. HOT 1
- Gradle plugin: ability to set the sourceset to which generated files are added
- how to generate jakarta imports in version 0.5.1 HOT 3
- How to declare one field as Map? HOT 2
- How to disable the set method for one field?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonschema2pojo.