reitit
reitit copied to clipboard
Rules are not correctly resolved to x-anyOf
I think this transformation
(malli.swagger/transform [:or int? string?])
;; => {:type "integer",
;; :format "int64",
;; :x-anyOf [{:type "integer", :format "int64"} {:type "string"}]}
should resolve to just
{:x-anyOf [{:type "integer", :format "int64"} {:type "string"}]}
I get the same behaviour when using spec transforms with (s/or ..)
constructs
I think :x-anyOf
is not official extension. Officially it's an integer. If you can point a documentation it should work differently, please share.
Hi Reading my report again I realize that it may have come out the wrong way. It was not my intention to tell anyone how it should work. I just tried to be to the point. Sorry about that.
I assumed x-anyOf
is intended to work like anyOf
in OAS3.
Documented here:
https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/
and here:
https://spec.openapis.org/oas/v3.1.0#fixed-fields-20
/Dan
We hope to support OpenAPI3 soon, so closing this.