Make JSON Keys Case Insensitive
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
Please search the existing issues for relevant feature requests, and use the reaction feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing requests.
#### Feature Description
Currently, the json keys while mostly the same between API calls to the http API, and setting up a configuration file for the consul agent to utilize, the cases are different, and causes an issue when running the agent or posting to the API with potentially the same file.
For Example:
```json
{
"service": {
"name":"myservice",
"port":443
}
}
```
and
```json
{
"Service": {
"Name":"myservice",
"Port":443
}
}
```
both above configurations are synonymous, however, the first json block would work with `consul agent -config-file=myfile.json` but it would fail if I were to `curl -X PUT -d @myfile.json http://myconsul:8500/v1/service/register` with unknown keys "service", "name", and "port", as the http API expects these to have a capital first letter, the same goes if you flip the scenario.
#### Use Case(s)
Currently it decouples these two things to a point of what can feel like obscurity at times, between testing and creating modular configurations that can be used either with an agent or via the API, it creates a lot of what can feel like "Busy work" to go between the two if you want/need to at any point. It also would make the http api docs a little more digestible as they would also work as a reference for the consul agent configuration options.
Contributor guide
Assessment
This issue has not been assessed yet.