[Bug] CLI fails to reload local dev env with no context when auth is set as Bearer in api.yml and no auth scheme is set
Describe the bug
Pretty much title. In the api.yml file, when setting the auth: parameter to something like Bearer, where the generator is expecting a subsequent
auth-schemes:
Bearer: ...
but none is provided, the cli docs dev tool will print Failed to reload because of validation errors: and nothing else.
To reproduce
Steps to reproduce the behavior:
- Run the command
fern docs devto set up local dev environment with auto reload - Write an api.yml file with an
auth:set to a capitalized word (as opposed to a lowercase, i.e.Bearervsbearer) with noauth-schemes:specified. - CLI tool will reload and state
Failed to reload because of validation errors:with no additional context, which makes this issue hard to debug.
Example api.yml:
name: api
auth: Bearer
error-discrimination:
strategy: status-code
display-name: Example API
environments:
Staging:
docs: This is the staging environment for testing!
url: http://api.exampleservice.com
default-environment: Staging
Expected behavior
I expect context in the error thrown by the cli pointing me to the api.yml file and telling me i have no auth-scheme specified.
Screenshots
CLI Version
0.30.0
this seems to be an issue in many other cases of invalid fern definition.
for example, when an invalid type is supplied (int instead of the correct, integer) the cli will provide no context as to why and will show the same error: Failed to reload because of validation errors:
Actually, issue can be easily resolved if the user just runs fern check --warnings. Was just expecting some context around the Failed to reload because of validation errors: due to the colon. Perhaps can change the error message to instruct the user to run fern check --warnings or provide some context after the colon? @dsinghvi feel free to close the issue though.
We've since improved the error messaging here to be more specific:
this is on version 0.46.2. feel free to run fern upgrade to get the latest CLI version.