Fork me on GitHub
#reitit
<
2023-08-22
>
Christopher Miles17:08:39

I'm using reitit-swagger to generate API documentation, it looks like the "definitions" are being placed in the schema inside the prarameters, but they should all be gathered at the top level... I attached a screenshot to try to get this across, the "$ref" is pointing to a "definitions" key that should be at the top level of the document but it's really nested in the schema. Has anyone else seen this and is there an easy fix?

hanDerPeder20:08:45

https://github.com/metosin/reitit/issues/558 If you scroll back a bit I have a post about this which include a workaround. For openapi but I imagine swagger would be similar.

❤️ 2
hanDerPeder20:08:46

The thread also includes a message from opqdonut saying he hopes to fix the issue proper next week

👍 2
Christopher Miles17:08:22

Understood, thank you! For now I'm fetching all of the schemas in the registry and using that to populate a top-level "definitions" attribute in the outbound data, then walking the structure to update the "ref" links. This works okay but is more of a patch; it definitely makes the output larger.