Giter Club home page Giter Club logo

Comments (7)

abramsz avatar abramsz commented on June 8, 2024

"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.

joelittlejohn avatar joelittlejohn commented on June 8, 2024

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.

Thomasator avatar Thomasator commented on June 8, 2024

@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.

Thomasator avatar Thomasator commented on June 8, 2024

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.

joelittlejohn avatar joelittlejohn commented on June 8, 2024

Are you able to edit the schema like this:

{ "existingJavaType" : "com.example.external_module.Person" }

?

from jsonschema2pojo.

Thomasator avatar Thomasator commented on June 8, 2024

@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.

Thomasator avatar Thomasator commented on June 8, 2024

@joelittlejohn

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.