Skip to content

Impossible to translate Stripe open api in graphql #284

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

Closed
renanbronchart opened this issue Dec 11, 2019 · 4 comments
Closed

Impossible to translate Stripe open api in graphql #284

renanbronchart opened this issue Dec 11, 2019 · 4 comments

Comments

@renanbronchart
Copy link

renanbronchart commented Dec 11, 2019

Describe the bug
I try to translate stripe openapi format in graphql schema with your package openapi-to-graphql.
It seems to don't work because the package cannot identify type of schema.
It seems to come with "anyOf" and "oneOf" words.

Error: Cannot process schema '{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/account"}],"description":"The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/account"}]}}'. Cannot identify type of schema.

To Reproduce

  • I install openapi-to-graphql cli
  • Launch openapi-to-graphql https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json --save schema.graphql

I try to test with stripe openAPI spec 2.0, but there is an other problem:

To Reproduce
openapi-to-graphql https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec2.json --save schema.graphql

Output
OpenAPI-to-GraphQL creation event error: Cannot process schema '{}'. Cannot identify type of schema.

@Alan-Cha
Copy link
Collaborator

@renanbronchart Thanks for filling this issue!

Your diagnosis is correct. We have issues dealing with a most of the JSON schema combining keywords, specifically anyOf, oneOf, and not. We have support for allOf however.

There have actually already been a few issues filed in regards to this issue #197 and #248. I am currently working on a fix but making very slow progress.

@renanbronchart
Copy link
Author

Thank you very much for your reply.
I'd watch the progress closely.

@Alan-Cha
Copy link
Collaborator

Actually, in PR #287, I already have anyOf and oneOf support and I've tried running some basic queries off the Stripe API and it works! Hoping to get the PR in Friday or early next week.

@Alan-Cha
Copy link
Collaborator

Alan-Cha commented Jan 28, 2020

We are finally able to handle the Stripe API! Update to v2.0.0 and take a look at this post!

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