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

How to create JSON schema based on a JSON data? #84

Closed
tpoxa opened this issue May 1, 2023 · 2 comments
Closed

How to create JSON schema based on a JSON data? #84

tpoxa opened this issue May 1, 2023 · 2 comments

Comments

@tpoxa
Copy link
Contributor

tpoxa commented May 1, 2023

Another odd question from me.

I am considering using JSON Schema to analyse the data structure without getting the data itself.
I know that is not precisely what this module is done for, but I still wonder if you might know or have any ideas @vearutop.

Thanks.

@vearutop
Copy link
Member

vearutop commented May 2, 2023

Hi, I'm not sure if I can really understand

to analyse the data structure without getting the data itself

From the title of the issue I assume you may want to infer schema from data sample(s).
If that's the case, have a look at https://github.com/swaggest/json-cli#buildschema and https://github.com/swaggest/json-schema-maker (DISCLAIMER: beware of PHP! 👻 ), later you can generate Go structures from such a schema with https://github.com/swaggest/json-cli#gengo.

If the problem you're trying to solve is different, please share some more details and/or examples.

@tpoxa
Copy link
Contributor Author

tpoxa commented May 3, 2023

Yes, that's the one I am trying to implement and generate JSON schema based on JSON data. Thanks for the tips. I'll take a look. PHP should be fine. I was Zend certified engineer many centuries ago.

@tpoxa tpoxa closed this as completed May 3, 2023
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