Skip to content

Generate JSON Schema consistency - #4

Open
charlypoly wants to merge 9 commits into
jakubfiala:masterfrom
charlypoly:fix/transform-valid-json-schema
Open

Generate JSON Schema consistency#4
charlypoly wants to merge 9 commits into
jakubfiala:masterfrom
charlypoly:fix/transform-valid-json-schema

Conversation

@charlypoly

@charlypoly charlypoly commented Apr 16, 2018

Copy link
Copy Markdown
Contributor

Pull request still in development

  • transform return a JSON Schema version draft-07
  • specs ensures that transform returns a valid JSON Schema using ajv lib
  • drop GRAPHQL_SCALAR, GRAPHQL_UNION and GRAPHQL_ENUM in generated strict schema

@jakubfiala jakubfiala left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @wittydeveloper, thanks for the pull requests! I'm going to bundle this with your other PR in one release and give you a shout when it's published.

@charlypoly

Copy link
Copy Markdown
Contributor Author

Hi @jakubfiala , thanks!

However, please wait, this PR is not ready yet 🙏

@jakubfiala

Copy link
Copy Markdown
Owner

oh sure, not merging it yet :)

@charlypoly

Copy link
Copy Markdown
Contributor Author

Hi @jakubfiala,

After many work on the JSON-Schema standard compliance, I found that many things generated by the lib are "invalid" JSON-Schema properties.

I maintain a fork of this project with a partial fix.
I'm pretty sure that my changes will introduce breaking changes in the generation of the JSON Schema .

In order to ship a version fully compliant with the JSON Schema standard, I will need to refactor a lot of the code and i'm not sure if this changes make senses for the purpose of this repo?

I was thinking creating a different project that generate strictly valid JSON Schema (by ignoring not compatible GraphQL types, etc), what do you think?

Cheers,

@jakubfiala

Copy link
Copy Markdown
Owner

Hey @wittydeveloper – really sorry for only getting back to this after a few months, they've been very busy ones. I think what you're proposing makes sense, my approach was to represent as much as possible of the GSL at the cost of potential non-compliance with JSON Schema, while your approach is the other way around.

Thanks for your contributions to this project!

@charlypoly

Copy link
Copy Markdown
Contributor Author

@jakubfiala No problem!

Sorry on my side too, considering I needed a GraphQL to JSON Schema tool pretty quick and also another result (compliant), I started a new package:
https://github.com/wittydeveloper/graphql-to-json-schema

I didn't want to edit too many things in your library, and especially I prefer working with TypeScript 😅

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

Successfully merging this pull request may close these issues.

2 participants