Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish a JSON Schema ... #105

Open
ullenboom opened this issue Jun 8, 2018 · 3 comments
Open

Publish a JSON Schema ... #105

ullenboom opened this issue Jun 8, 2018 · 3 comments

Comments

@ullenboom
Copy link

... so ppl can use this JSON Schema to generate proper access classes e.g. in Java.

@mickster04
Copy link

run the api in your browser
https://randomuser.me/api/1.2?results=1&format=pretty

then paste into

http://www.jsonschema2pojo.org/

and you win?

@ullenboom
Copy link
Author

Doesn't work all the time. I do in my Java courses but the problem is the postcode, like

"postcode": 11633,

for a German address. It will be inferred to a integer type, but other countries use strings. If the generator is always printings strings it would be fine again ...

@mickster04
Copy link

using the jsonschema2pojo i mentioned before, change the 11633 into "11633" it should work no? Or just change it from an integer to a string in the code it generates, then make sure you use a specific version of the API and you don't have to worry about it changing underneath you?

in NZ they are numbers only too, so I have to make sure they're strings in my code, especially as there are leading 0s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants