examples/openapi: fix /complex example

This commit is contained in:
Joel Kaasinen 2026-01-09 11:28:04 +02:00
parent 373ea9bb62
commit bf18586d75
No known key found for this signature in database
2 changed files with 9 additions and 8 deletions

View file

@ -4,6 +4,7 @@
[metosin/jsonista "0.3.8"] [metosin/jsonista "0.3.8"]
[ring/ring-jetty-adapter "1.12.1"] [ring/ring-jetty-adapter "1.12.1"]
[metosin/reitit "0.10.0"] [metosin/reitit "0.10.0"]
[metosin/ring-swagger-ui "5.9.0"]] [metosin/ring-swagger-ui "5.9.0"]
[org.slf4j/slf4j-simple "2.0.9"]]
:repl-options {:init-ns example.server} :repl-options {:init-ns example.server}
:profiles {:dev {:dependencies [[ring/ring-mock "0.4.0"]]}}) :profiles {:dev {:dependencies [[ring/ring-mock "0.4.0"]]}})

View file

@ -156,22 +156,22 @@
[:regex [:re "[0-9]+"]] [:regex [:re "[0-9]+"]]
[:enum [:enum 1 3 5 42]] [:enum [:enum 1 3 5 42]]
[:multi [:multi {:dispatch :type} [:multi [:multi {:dispatch :type}
[:literal [:map ["literal" [:map
[:type [:= :literal]] [:type [:= "literal"]]
[:value [:or :int :string]]]] [:value [:or :int :string]]]]
[:reference [:map ["reference" [:map
[:type [:= :reference]] [:type [:= "reference"]]
[:description :string] [:description :string]
[:ref :uuid]]]]]] [:ref :uuid]]]]]]
:example {:vector-of-tuples [["a" 1] ["b" 2]] :example {:vector-of-tuples [["a" 1] ["b" 2]]
:regex "01234" :regex "01234"
:enum 5 :enum 5
:multi {:type :literal :multi {:type "literal"
:value "x"}}}}} :value "x"}}}}}
:responses {200 {:content {:default {:schema [:map]}}}} :responses {200 {:content {:default {:schema [:map-of :keyword :any]}}}}
:handler (fn [request] :handler (fn [request]
{:status 200 {:status 200
:body (:body request)})}}] :body (get-in request [:parameters :request])})}}]
["/secure" ["/secure"
{:tags #{"secure"} {:tags #{"secure"}