Fork me on GitHub
#ring
<
2020-02-13
>
robertfw17:02:12

I had similar needs - specs being kebab-case, but API is specified and validated for underscore. Didn't find an acceptable solution - we were working off of json schemas and so I ended up using those for in-production validation, had middleware to kebab-case any request data, then used kebab-cased specs internally

robertfw17:02:13

not the cleanest setup and hoping to revisit this possibly when spec2 comes out, which has some improvements for programmatically making specs. that could make it easier to alter a spec to use a different casing

plins23:02:57

Im thinking of doing the same thing, one middleware to change the swagger json to camelCase and another one to convert the data to kebab case when a request arrives