This summer I upgraded Reitit in an app and switched to OpenAPI 3. However, I apparently didn't test it enough in Swagger UI, as now I have an issue with certain schemas where the parameter list ends up empty.
{:query [:and [:map
[:x int?]
[:y int?]]
[:fn #(< (:x %) (:y %))]]}
This applies to body parameters as well. Removing the :and and just using the map, makes it work like it did with OpenAPI 2, aka Swagger. For now, I've switched out the create-openapi-handler with create-swagger-handler and registered an issue on Github. But I'm just wondering if anyone knows if this is intentional? If so I'll have to move some of the validation into a different layer (either the handler or make an additional middleware).commenting here as well as on github: the problem is that the :query parameter spec should be an actual :map, because the OpenAPI spec generation needs to iterate through the children. Supporting :and in general would be tricky, and I don't like the idea of adding a special case for [:and :map :fn]. I've added a warning that triggers when the :query spec isn't a :map.
hmm
so :and maps to :allOf in json-schema, and :fn maps to an empty schema
I'll need to dig into this... I'm not sure what the right way to handle :and would be in general
note to self, this is the issue: https://github.com/metosin/reitit/issues/705