Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-spec -> swagger returns empty map #254

Open
nikolavojicic opened this issue Jun 21, 2021 · 0 comments
Open

multi-spec -> swagger returns empty map #254

nikolavojicic opened this issue Jun 21, 2021 · 0 comments

Comments

@nikolavojicic
Copy link

Generating Swagger / OpenApi / JsonSchema from multi-spec returns empty map:

  (s/def ::string string?)
  (s/def ::number number?)
  (defmulti foo :type)
  (defmethod foo "string" [_] (s/keys :req-un [::string]))
  (defmethod foo "number" [_] (s/keys :req-un [::number]))
  (s/def ::foo (s/multi-spec foo :type))

  (gen/sample (s/gen ::foo))
  #_({:number -2.0, :type "number"}
     {:number -0.5, :type "number"}
     {:number -2, :type "number"}
     {:number -1, :type "number"}
     {:number -1, :type "number"}
     {:string "dqo6", :type "string"}
     {:number -0.5, :type "number"}
     {:string "7FtR", :type "string"}
     {:number -1.859375, :type "number"}
     {:string "91C", :type "string"})

  (swagger/transform ::foo)
  #_{}
  (openapi/transform ::foo)
  #_{}
  (json-schema/transform ::foo)
  #_{}

Is there any workaround for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant