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

Path to OpenAPI spec file is required in CLI command even when using a --settings-file parameter. #149

Closed
Ekkeir opened this issue Sep 12, 2023 · 5 comments · Fixed by #160
Assignees
Labels
bug Something isn't working

Comments

@Ekkeir
Copy link

Ekkeir commented Sep 12, 2023

A new and a very convenient feature allows us to use refitter file via CLI with a --settings-file option in the following manner:
refitter ./openapi.json --settings-file ./openapi.refitter.

The path to OpenAPI spec file (./openapi.json) cannot be dropped from the CLI command as it results in Input file is required error.

At the same time refitter file has an openApiPath parameter with seemingly the same meaning. Thus it seems redundant and error-prone to have a mandatory path in a CLI command as it becomes unclear which of the paths would be used in the end - the one in CLI command or the one in .refitter file.

@Ekkeir Ekkeir added the bug Something isn't working label Sep 12, 2023
@christianhelle
Copy link
Owner

christianhelle commented Sep 12, 2023

@Ekkeir thanks for taking the time to report this

This can definitely be improved, and rather easily as well.

I can make the mandatory input file argument optional so users can decide to specify it via the settings file instead

@christianhelle
Copy link
Owner

@all-contributors please add @Ekkeir for bug

@allcontributors
Copy link
Contributor

@christianhelle

I've put up a pull request to add @Ekkeir! 🎉

@Ekkeir
Copy link
Author

Ekkeir commented Sep 12, 2023

@Ekkeir thanks for taking the time to report this

This can definitely be improved, and rather easily as well.

I can make the mandatory input file argument optional so users can decide to specify it via the settings file instead

@christianhelle Sounds great.
Optionally there could be a warning or an outright error in one of or both of the following cases

  • path is configured in both URL and refitter file
  • different paths are configured in URL and refitter file, user would (at least) want to know that there's a discrepancy and which path is used

On the other hand, though, it could be covered by documentation as a declared behaviour instead of runtime error/warning.

@christianhelle
Copy link
Owner

@Ekkeir I think I can find some time to work on this today

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.

2 participants