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

Suggestion: Make (middleware) config case-agnostic #893

Open
nkappler opened this issue Aug 5, 2022 · 5 comments
Open

Suggestion: Make (middleware) config case-agnostic #893

nkappler opened this issue Aug 5, 2022 · 5 comments
Assignees

Comments

@nkappler
Copy link
Contributor

nkappler commented Aug 5, 2022

There's probably no particular reason that middleware and other config options are case-sensitive.

I think it would be easier for inexperienced users, if this was made case-insensitive, as it might otherwise fail silently.
The API will still work but the otherwise correctly spelled configuration might have no effect.

@nkappler nkappler changed the title Suggestion: Make (middleware) config case agnostic Suggestion: Make (middleware) config case-agnostic Aug 5, 2022
@mevdschee mevdschee self-assigned this Aug 5, 2022
@mevdschee
Copy link
Owner

Good issue. Might be better indeed, since environment parameters are not case sensitive either.

@mevdschee
Copy link
Owner

I was thinking that maybe we should convert all config from 'camelCase' to 'snake_case', before making them case-insensitive. Maybe we can detect mixed case and convert (for legacy naming).

@mevdschee
Copy link
Owner

Thinking in a different direction: we could give appropriate error messages before executing the script for wrong case properties, so that they wont fail silently.

@nkappler
Copy link
Contributor Author

nkappler commented Aug 9, 2022

I don't really have an opinion on which option I prefer, but everything is better than failing silently 😅
However, while error messages can point the user in the right direction, the user then still needs to update the configuration and reupload the api to the server.
If this is only caused by a case-inconsistency, it can be quite annoying, but could be easily avoided.

I think adding the error messages should be done in either case, but it should not be the only thing changed 🙂

@nkappler
Copy link
Contributor Author

nkappler commented Aug 9, 2022

I guess I slightly prefer my original proposal of keeping it camel-case but ignoring the case in addition to adding error messages, because I think it might be less work than switching to snake_case and it doesn't introduce a breaking change / the need for legacy support...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants