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

Getting "Invalid YAML from provided source" error although it worked with Postman and the spec format is JSON #1094

Open
AmeerSadek opened this issue Aug 13, 2024 · 1 comment

Comments

@AmeerSadek
Copy link

I am trying to generate a client for an OpenAPI JSON file but I am getting an error although Postman was able to generate a endpoints:
"Error(s) encountered while generating, client was not created
Invalid YAML from provided source: mapping values are not allowed in this context"

This is the link to the OpenAPI spec: https://github.com/sourcenetwork/defradb/blob/develop/docs/website/references/http/openapi.json

Desktop (please complete the following information):

  • OS: Windows 11
  • Python Version: 3.12.5
  • openapi-python-client version: 0.21.2
@AmeerSadek AmeerSadek changed the title Getting "Invalid YAML from provided source" error although it worked with Postman and it is a JSON file Getting "Invalid YAML from provided source" error although it worked with Postman and the spec format is JSON Aug 13, 2024
@KrisEhl
Copy link

KrisEhl commented Aug 14, 2024

Hi,
you were likely using the link provided directly with the --url argument. This page contains additional information on top of the specs.

Instead you want to use the "Raw" version of that page, i.e. something like

openapi-python-client generate --url https://raw.githubusercontent.com/sourcenetwork/defradb/develop/docs/website/references/http/openapi.json

This allowed me to generate the client.
I just got some warnings regarding invalid http status code "default", you seem to have in your specs.

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