Skip to content

Bug on parsing config.yml file #538

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
motybz opened this issue Nov 16, 2021 · 6 comments · Fixed by #544
Closed

Bug on parsing config.yml file #538

motybz opened this issue Nov 16, 2021 · 6 comments · Fixed by #544
Labels
🐞bug Something isn't working
Milestone

Comments

@motybz
Copy link

motybz commented Nov 16, 2021

We upgrade the version from 0.10.5 to 0.10.7
While we trying to generate a client with a config file the process failed

openapi-python-client generate --url=http://localhost:8000/latest/openapi.json --config=config.yml

Usage: openapi-python-client generate [OPTIONS]

Error: Invalid value: Unable to parse config

Without the config file, it works perfectly
The config file content:

project_name_override: doogle-rest-client
package_name_override: doogle_rest_client
package_version_override: 0.0.1

The issue does not appear in 0.10.5 version

Desktop (please complete the following information):

  • OS: ubuntu 18.04
  • Python Version: 3.7
  • openapi-python-client version - 0.10.7
@motybz motybz added the 🐞bug Something isn't working label Nov 16, 2021
@dbanty
Copy link
Collaborator

dbanty commented Nov 16, 2021

How strange 🧐. 0.10.6 added support for JSON config files, this must have broken something with YAML. We use a config.yml in our end to end tests though so it's not completely broken

@motybz
Copy link
Author

motybz commented Nov 17, 2021

Indeed, those fields are not used in the end2end tests...
Maybe it is worth to add verbosity level to the cli endpoint to understand what happened

@motybz
Copy link
Author

motybz commented Nov 25, 2021

@dbanty any thoughts?
Maybe it is worth adding those fields to the end2end tests, probably it will verify my suspision

@MalteBecker
Copy link
Contributor

I had the same problem. For me it works to use the absolute path to the config file.

Windows 10
Python 3.9
openapi-python-client 10.7

@abhinav-cashify
Copy link

I had the same problem. For me it works to use the absolute path to the config file.

Windows 10 Python 3.9 openapi-python-client 10.7

I was getting same error on both json and yaml file. This worked for me too.

macOS Big Sur Version 11.6
Python 3.9
openapi-python-client 0.10.7

@dbanty
Copy link
Collaborator

dbanty commented Dec 1, 2021

Interesting, it must be a problem with the content type detection. I thought we were converting to absolute paths before parsing internally but maybe not.

Glad there's a workaround for now, but obviously this still needs fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants