-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
Description
Hello,
In my project I have used ring.swagger.json-schema/describe to annotate some types
(require '[ring.swagger.json-schema :refer [describe]] '[schema.core :as s])
(s/defschema Foo (describe s/Str "Not very bar"))However the schema-tools.swagger.core/transform failed on this
(require '[schema-tools.swagger.core])
(schema-tools.swagger.core/transform Foo nil)
;; Execution error (ExceptionInfo) at schema-tools.swagger.core/not-supported! (core.cljc:56).
;; don't know how to convert ring.swagger.json_schema.FieldSchema@8d6443 into a Swagger Schema. I have had to do the following
(import ring.swagger.json_schema.FieldSchema)
(extend-protocol schema-tools.swagger.core/SwaggerSchema
FieldSchema
(-transform [this opts]
(schema-tools.swagger.core/transform (.schema this) opts)))to get it working.
I am not sure if there should be support for this module in schema-tools, but at least it gave me some headache while trying to move from compojure-api to Reitit, so maybe it should be supported somewhere in the toolchain if I am not alone using that function !
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Not right now