-
Notifications
You must be signed in to change notification settings - Fork 257
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
OpenAPI 3 parameter documentation not generated for :and #705
Comments
The problem is that the We should probably add a warning for the case when the OpenAPI generation fails to find the individual query params. We could also add special case support for The reason this works in Swagger/OpenAPI2 is that the version of ;; Input
[:and
[:map [:x int?] [:y int?]]
[:fn #(< (:x %) (:y %))]] ;; OpenAPI 2 output
{:properties {:x {:format "int64", :type "integer"}, :y {:format "int64", :type "integer"}},
:required [:x :y],
:type "object",
:x-allOf [{:properties {:x {:format "int64", :type "integer"},
:y {:format "int64", :type "integer"}},
:required [:x :y],
:type "object"}
{}]} ;; OpenAPI 3 output
{:allOf [{:properties {:x {:type "integer"}, :y {:type "integer"}},
:required [:x :y],
:type "object"}
{}]} |
I've added a warning for this. |
I can see how supporting every possible permutation of a schema that is valid for coercion would be tricky. I would imagine E.g. this shouldn't be a problem: [:and [:map [:x :int]]
[:map [:y :int]] But something like the following doesn't make sense, and would be impossible to generate a spec from: [:and [:map [:x :int]]
[:map [:x :string]] And then there's of course a question of whether |
Yeah the core problem here is that OpenAPI wants to model each query parameter separately, so there's really no way to even express something like PS. this is for query params. For body params, |
With the older OpenAPI 2 support I could define parameters to have top-level validation like so:
The parameters would show up in the generated JSON and in Swagger UI. When I change to
create-openapi-handler
, the parameter list for the endpoint is empty.Is this by design? Do I need to move this kind of validation out of the Malli coercion flow?
The text was updated successfully, but these errors were encountered: