Skip to content

Commit

Permalink
doc: clarify :content-types in example/openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
opqdonut committed Aug 28, 2023
1 parent 7b41882 commit 5d0bce1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/openapi/src/example/server.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

["/pizza"
{:get {:summary "Fetch a pizza | Multiple content-types, multiple examples"
:content-types ["application/json" "application/edn"]
:responses {200 {:content {"application/json" {:description "Fetch a pizza as json"
:schema [:map
[:color :keyword]
Expand All @@ -51,7 +50,6 @@
:body {:color :red
:pineapple true}})}
:post {:summary "Create a pizza | Multiple content-types, multiple examples"
:content-types ["application/json" "application/edn"]
:request {:content {"application/json" {:description "Create a pizza using json"
:schema [:map
[:color :keyword]
Expand All @@ -64,6 +62,8 @@
[:pineapple :boolean]]
:examples {:purple {:value (pr-str {:color :purple
:pineapple false})}}}}}
;; Need to list content types explicitly because we use :default in :responses
:content-types ["application/json" "application/edn"]
:responses {200 {:content {:default {:description "Success"
:schema [:map [:success :boolean]]
:example {:success true}}}}}
Expand Down

0 comments on commit 5d0bce1

Please sign in to comment.