From 4d1d4696865f3905cdd461bf26b605f844c5e82e Mon Sep 17 00:00:00 2001 From: Joel Kaasinen Date: Mon, 28 Aug 2023 12:45:16 +0300 Subject: [PATCH] test: test multiple examples using new syntax --- test/cljc/reitit/openapi_test.clj | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/test/cljc/reitit/openapi_test.clj b/test/cljc/reitit/openapi_test.clj index 3724b7ac..acfd2966 100644 --- a/test/cljc/reitit/openapi_test.clj +++ b/test/cljc/reitit/openapi_test.clj @@ -472,22 +472,13 @@ [["/examples" {:post {:decription "examples" :coercion @coercion - :request {:body (->schema :b)} + :request {:content {"application/json" {:schema (->schema :b) + :examples {"named-example" {:description "a named example" + :value {:b "named"}}}}}} :parameters {:query (->schema :q)} :responses {200 {:description "success" - :body (->schema :ok)}} - :openapi {:requestBody - {:content - {"application/json" - {:examples - {"named-example" {:description "a named example" - :value {:b "named"}}}}}} - :responses - {200 - {:content - {"application/json" - {:examples - {"response-example" {:value {:ok "response"}}}}}}}} + :content {"application/json" {:schema (->schema :ok) + :examples {"response-example" {:value {:ok "response"}}}}}}} :handler identity}}] ["/openapi.json" {:get {:handler (openapi/create-openapi-handler)