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

Missing file is never reached in openapi2jsonschema.py #239

Closed
AndersBennedsgaard opened this issue Nov 3, 2023 · 2 comments
Closed

Missing file is never reached in openapi2jsonschema.py #239

AndersBennedsgaard opened this issue Nov 3, 2023 · 2 comments

Comments

@AndersBennedsgaard
Copy link

I needed a tool to convert Kubernetes CRDs into JSON schemas, and found your awesome openapi2jsonschema.py script.
Looking through it, I noticed

if __name__ == "__main__":
if len(sys.argv) == 0:
print("missing file")
exit(1)

As I understand sys.argv this if-statement will never be true since the first entry in the sys.argv list will always be the file name, and therefore the length of the list will never be 0.

@yannh
Copy link
Owner

yannh commented Nov 18, 2023

Thanks for the report, that seems correct! 👍

@yannh
Copy link
Owner

yannh commented Nov 18, 2023

Fixed in #244

@yannh yannh closed this as completed Nov 18, 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