You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the request params, the result of merging the :path_params on top of :body_params on top of :query_params
When using OpenApiSpex.Plug.CastAndValidate plug the params will overwrite only with params from :path | :query | :header | :cookie meaning that there is never parameters from request_body there.
This should be clearly stated in CastAndValidateplug like it is for cast plug as it can cause some confusion.
The text was updated successfully, but these errors were encountered:
The library was initially implemented with all params merged into conn.params as per the docs. Unfortunately it is problematic with struct based body schemas.
If your body schema is a struct, the adding additional query params creates a struct with undeclared fields set. It technically works since structs are just maps, but it is confusing and may cause type errors in future elixir versions.
According to Plug documentation
conn.params
isWhen using
OpenApiSpex.Plug.CastAndValidate
plug the params will overwrite only with params from:path | :query | :header | :cookie
meaning that there is never parameters fromrequest_body
there.This should be clearly stated in
CastAndValidate
plug like it is for cast plug as it can cause some confusion.The text was updated successfully, but these errors were encountered: