refactor: -get-model-apidocs for schema & spec

not used yet tho
This commit is contained in:
Joel Kaasinen 2023-08-28 09:02:11 +03:00
parent f943b025cb
commit 051452231a
2 changed files with 14 additions and 0 deletions

View file

@ -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.

View file

@ -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