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

s/keys + clojure.core/or -> swagger returns or args as required #256

Open
nikolavojicic opened this issue Jul 1, 2021 · 0 comments
Open

Comments

@nikolavojicic
Copy link

Using clojure.core/or inside :req of s/keys, when transformed to openapi / swagger / json-schema, shows all its args as required, which is not correct:

(s/def ::foo string?)
(s/def ::bar string?)
(s/def ::baz number?)

(openapi/transform (s/keys :req-un [::foo (or ::bar ::baz)]))
;=>
{:type "object",
 :properties
 {"foo" {:type "string"},
  "bar" {:type "string"},
  "baz" {:type "number", :format "double"}},
 :required ["foo" "bar" "baz"]}
@nikolavojicic nikolavojicic changed the title s/keys + clojure.core/or -> swagger returns args to or as required s/keys + clojure.core/or -> swagger returns or args as required Jul 1, 2021
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