This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-18
Channels
- # alda (8)
- # aws (1)
- # bangalore-clj (1)
- # beginners (55)
- # boot (114)
- # capetown (2)
- # cljs-dev (51)
- # cljsjs (1)
- # cljsrn (14)
- # clojure (119)
- # clojure-belgium (6)
- # clojure-brasil (9)
- # clojure-conj (2)
- # clojure-greece (1)
- # clojure-korea (2)
- # clojure-poland (12)
- # clojure-russia (64)
- # clojure-spec (12)
- # clojure-uk (60)
- # clojurescript (159)
- # code-reviews (2)
- # component (4)
- # core-matrix (2)
- # cursive (79)
- # datascript (7)
- # datomic (2)
- # defnpodcast (4)
- # events (2)
- # hoplon (13)
- # jobs (2)
- # lein-figwheel (1)
- # off-topic (10)
- # om (42)
- # onyx (60)
- # pedestal (5)
- # perun (7)
- # rdf (4)
- # re-frame (4)
- # reagent (21)
- # ring-swagger (25)
- # schema (1)
- # spacemacs (52)
- # specter (1)
- # utah-clojurians (1)
- # yada (5)
hi.. is it supported to use sequence of custom types in a schema... something like {:id s/Int :collection [AnotherSchema]} ? having some trouble with it.. says "don't know how to convert"
thanks... i actually tried it and it works.. but in my code where its not working, the problematic collection is in a schema defined by "abstract-map-schema" .. im using it as a sort of "base class" to get some common properties to extended schemas.. ill try to make a small example with abstract-map-schema
AnotherSchema is just a simple schema: something like (def AnotherSchema {:id s/Int :name s/Str})
ah. The abstract-map-schema
is problematic, swagger doesn't support one-of
or any-of
. There is a mapping for it in
try importing that. And if you know how the mapping should be implemented, please PR, we could add it to default mappings. Currently could emit broken swagger spec..
its just enough to add (:use [ring.swagger.json-schema-dirty]) in my namespace, right?
now it outputs: "<span class="strong">AbstractBaseSchema is not defined!</span>" in swagger
@sammikko I guess there is not a [:definitions “AbstractBaseSchema”]
in the swagger.json?
ok, that’s not right. But as said, the abstract-* schemas are not supported. Please file a issue out of that.
yeah, i was just thinking if i could make it with just ordinary maps and use merge or something
i probably need to use separate paths /concretetype1, /concretetype2 etc. for the POST requests used to create those types to be able to generate sensible swagger 2.0 out of it.. i think thats what you ment by that "one-of" or "any-of" is not supported in swagger 2.0
here’s on of the issues: https://github.com/OAI/OpenAPI-Specification/issues/57 (from 2014…)