This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-28
Channels
- # aws-lambda (2)
- # beginners (49)
- # boot (49)
- # cider (7)
- # clara (1)
- # cljsrn (4)
- # clojure (199)
- # clojure-android (49)
- # clojure-dev (1)
- # clojure-greece (4)
- # clojure-italy (3)
- # clojure-nl (4)
- # clojure-norway (5)
- # clojure-russia (78)
- # clojure-spec (22)
- # clojure-uk (18)
- # clojurebridge (2)
- # clojurescript (252)
- # core-typed (2)
- # cursive (11)
- # data-science (1)
- # datascript (2)
- # datomic (38)
- # devcards (1)
- # flambo (3)
- # hoplon (10)
- # immutant (2)
- # jobs (3)
- # luminus (1)
- # lumo (2)
- # off-topic (8)
- # om (3)
- # onyx (29)
- # parinfer (1)
- # pedestal (4)
- # portkey (13)
- # re-frame (13)
- # reagent (6)
- # ring (3)
- # ring-swagger (15)
- # schema (2)
- # spacemacs (4)
- # test-check (4)
- # untangled (46)
- # yada (2)
How does one define the schema of a response as array of objects which's defintion can be referenced?
I tried: :schema [{:$ref "#/definitions/User"}]
but this will get me don't know how to convert #/definitions/User into a Swagger Schema
@ikitommi ok, can't i use normal schema defintions like:
:definitions {"User" {:type "object"
:properties {:name {:type "string"}
:password {:type "string"}}
:additionalProperties false
:required (:name :password)}}}
btw: you suggestion worked
No, currently you can’t mix JSON Schema & Plumatic Schemas, do you have a use case for needing to mix those?
oh and: this is a play project, i'd never expose users passwords in a reponse 😄
@ikitommi no, now that i see its more convinient to use defschema
, i woulnd't see that
@lambder looks like a bug. But swagger 2.0 doesn’t support :anyOf
, so we in the end, we have to produce something. With either
it takes the first one of the list. But it should be R
I think. Would you like to fix it?
@lambder both :anyOf
and :oneOf
are in 3.0. Would someone be interested in adding support for that? maybe a swagger3
ns? My 3 years old issue for the either btw: https://github.com/OAI/OpenAPI-Specification/issues/57
here are btw the clojure.spec to JSON Schema mappings (with :anyOf
and :oneOf
): https://github.com/metosin/spec-tools/blob/master/src/spec_tools/json_schema.cljc