Skip to content
Snippets Groups Projects
Unverified Commit caded0ff authored by Alexander Solovyov's avatar Alexander Solovyov Committed by GitHub
Browse files

report correct undefined parameters in dev log messages (#34516)

allowed-params should be keywords, because they are compared with keys in
a body map, which are keywords
parent d0cb6d66
No related branches found
No related tags found
No related merge requests found
......@@ -272,7 +272,7 @@
[{:keys [method route fn-name docstr args body arg->schema]}]
{:pre [(or (string? route) (vector? route))]}
(let [method-kw (method-symbol->keyword method)
allowed-params (keys arg->schema)
allowed-params (mapv keyword (keys arg->schema))
prep-route #'compojure/prepare-route
multipart? (get (meta method) :multipart false)
handler-wrapper (if multipart? mp/wrap-multipart-params identity)]
......
......@@ -140,7 +140,7 @@
:lonlat [0.0 0.0]}}))))
(is (some (fn [{message :msg, :as entry}]
(when (str/includes? (str message)
(str "Unexpected parameters at [:post \"/post/test-address\"]: [:tags :address :id]\n"
(str "Unexpected parameters at [:post \"/post/test-address\"]: [:tags :id]\n"
"Please add them to the schema or remove them from the API client"))
entry))
(mb.logger/messages))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment