Skip to content

camelCase JSON responses and snake_case parameters #144

Answered by janko
Graditude-Dev asked this question in Q&A
Discussion options

You must be logged in to vote

Interesting use case, I can understand the wish to decouple naming conventions. Normally you could rename Rodauth parameters via *_param settings.

FYI, the reason 1️⃣ didn't work was because it's a copy of Rack parameters cached under a Rails-specific env key, so Rodauth doesn't detect the change. As for 2️⃣, Rodauth uses Roda's JSON parser for parsing the request body, so Action Dispatch doesn't get called here. I'm not sure why 3️⃣ doesn't work; the only important thing is that Rodauth::Rails::Middleware gets inserted after this middleware, which it should given that it gets inserted after user-defined initializers.

For Rodauth, I recommend overriding Roda's JSON request body parser and…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Graditude-Dev
Comment options

Answer selected by Graditude-Dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants