Skip to content

Commit

Permalink
Merge pull request #706 from metosin/openapi-query-warning-master
Browse files Browse the repository at this point in the history
feat: add warning for unsupported openapi parameter schemas
  • Loading branch information
opqdonut authored Nov 7, 2024
2 parents 86e0441 + c89b6bb commit 0f94148
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/reitit-malli/src/reitit/coercion/malli.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@
;; For :parameters we need to output an object schema with actual :properties.
;; The caller will iterate through the properties and add them individually to the openapi doc.
;; Thus, we deref to get the actual [:map ..] instead of some ref-schema.
(json-schema/transform (m/deref model) (merge opts options))
(let [should-be-map (m/deref model)]
(when-not (= :map (m/type should-be-map))
(println "WARNING: Unsupported schema for OpenAPI (expected :map schema)" (select-keys options [:in :parameter]) should-be-map))
(json-schema/transform should-be-map (merge opts options)))
(json-schema/transform model (merge opts options)))
(throw
(ex-info
Expand Down

0 comments on commit 0f94148

Please sign in to comment.