mirror of
https://github.com/metosin/reitit.git
synced 2026-01-09 08:39:50 +00:00
refactor: -get-model-apidocs for schema & spec
not used yet tho
This commit is contained in:
parent
f943b025cb
commit
051452231a
2 changed files with 14 additions and 0 deletions
|
|
@ -47,6 +47,13 @@
|
|||
(reify coercion/Coercion
|
||||
(-get-name [_] :schema)
|
||||
(-get-options [_] opts)
|
||||
(-get-model-apidocs [_ specification model options]
|
||||
(case specification
|
||||
:openapi (openapi/transform model (merge opts options))
|
||||
(throw
|
||||
(ex-info
|
||||
(str "Can't produce Schema apidocs for " specification)
|
||||
{:type specification, :coercion :schema}))))
|
||||
(-get-apidocs [_ specification {:keys [request parameters responses content-types]
|
||||
:or {content-types ["application/json"]}}]
|
||||
;; TODO: this looks identical to spec, refactor when schema is done.
|
||||
|
|
|
|||
|
|
@ -88,6 +88,13 @@
|
|||
(reify coercion/Coercion
|
||||
(-get-name [_] :spec)
|
||||
(-get-options [_] opts)
|
||||
(-get-model-apidocs [_ specification model options]
|
||||
(case specification
|
||||
:openapi (openapi/transform model (merge opts options))
|
||||
(throw
|
||||
(ex-info
|
||||
(str "Can't produce Spec apidocs for " specification)
|
||||
{:type specification, :coercion :spec}))))
|
||||
(-get-apidocs [_ specification {:keys [request parameters responses content-types]
|
||||
:or {content-types ["application/json"]}}]
|
||||
(case specification
|
||||
|
|
|
|||
Loading…
Reference in a new issue