Closed mkreis closed 1 month ago
Might be related to https://github.com/metosin/reitit/issues/616
But only very loosely. As far as I understand, https://github.com/metosin/reitit/issues/616 is about the overall location of definitions for the OpenAPI schema, whereas here it is about missing parts in the definition.
Thanks for the report! I only noticed it now since it's in this repo and not reitit. I think I see the where the problem is.
I'm unable to reproduce this with malli 0.16.0 and the latest reitit master. The code in malli does look a bit suspicious. Do you have a working reproduction @mkreis ?
I can try to reproduce it with malli 0.16.0 and add the results here.
Hi @opqdonut , I managed to recreate it with a simple project: https://github.com/mkreis/malli-issue-1002 As it turned out, the probem is caused by multiple entries in the :parameters map, e.g. parameters for :path, :query and :body at the same time. If there is only one key, then the definitions are exported. With multiple keys, it's broken. In my sample project above, I have marked the particular section in file service.clj.
Thanks! I'll try to have a look tomorrow.
Cool, thank you!
Also I just noticed that it works if key :body is the first key in the :parameters map. So it might be easy to fix... I hope.
I think I found a bug regarding Swagger Schema generation:
Only definitions from schemas referred to in responses are shown as global definitions in
/definitions
, but those from requests are missing.With the following Reitit route config
only company2 will be in
/definitions
(although theref$
to both def’s are there, thus causing a missing/invalid reference to company1).I'm using Malli 0.14.0 and Reitit 0.7.0-alpha7