You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm envisaging that you've got a few modules sitting at various contexts, then a fallback root module with the composite renderer. Is that what you had in mind? So along the lines of:
/context1/swagger.json
/context2/swagger.json
/swagger.json <-- composite with $refs
The trickiest part is getting the API to look nice. Easiest option would probably be to have a CompositeModule function which takes a bunch of other modules or creates them in a builder like way (see below):
CompositeModule(Root, CompositeRenderer)
.withModules(m1, m2, m3)
However, since the Module is not typed by the Renderer implementation, it would currently not be possible to have the compiler guarantee that all of the submodules were in fact Swagger modules, so an alternative is to have the "super" module create the submodules and pass them to a function for configuration:
Suggested by @ncreep:
Something along these lines https://azimi.me/2015/07/16/split-swagger-into-smaller-files.html it should be simple to add, since we just need to get the description base-paths from each of the other modules and use them to generate the composite JSON doc.
I'm envisaging that you've got a few modules sitting at various contexts, then a fallback root module with the composite renderer. Is that what you had in mind? So along the lines of:
/context1/swagger.json
/context2/swagger.json
/swagger.json <-- composite with $refs
The trickiest part is getting the API to look nice. Easiest option would probably be to have a CompositeModule function which takes a bunch of other modules or creates them in a builder like way (see below):
CompositeModule(Root, CompositeRenderer)
.withModules(m1, m2, m3)
However, since the Module is not typed by the Renderer implementation, it would currently not be possible to have the compiler guarantee that all of the submodules were in fact Swagger modules, so an alternative is to have the "super" module create the submodules and pass them to a function for configuration:
val m: Module = SwaggerCompositeModule(Root)
.withModule(_ / "context", {
module =>
module.withRoute(r1).withRoute(r2)
})
The text was updated successfully, but these errors were encountered: