Prevent operation
from casting map keys to symbols
#520
Unanswered
LukasKnuth
asked this question in
Q&A
Replies: 2 comments 1 reply
-
@LukasKnuth What is the desired behaviour in your case? Would you prefer the library to omit the undocumented attributes or to not atomise keys? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I've since dug into the source code of the library and found some answers:
There is AFAIK no way to configure or prevent this behavior. I have now solved it by specifically setting |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using the
operator
macro in my Controller to define therequest_body
I'm expecting users to provide. That body uses a module and theOpenApiSpex.schema
helper macro.Now in my test, I have observed the following issue:
So as far as I can tell, all known body parameters are changed to have symbol keys, while the unknown parameters remain string keys (as given by Plug).
This causes problems when passing this to
Ecto.Changeset.cast
:Can I deactivate this behavior? I haven't been able to find documentation on it. I tried the
struct?: false
option, but that doesn't seem to change anything.Beta Was this translation helpful? Give feedback.
All reactions