Documenting response headers added by an interceptor

If you have a list of endpoints for which you want to generate documentation, you can modify that list before passing it to the documentation interpreter. E.g.:

val myEndpoints: List[AnyEndpoint] = ???

val myEndpointsWithHeader = myEndpoints.map(_.out(header(...)))

val swaggerEndpoints = SwaggerInterpreter().fromEndpoints[Future](myEndpointsWithHeader, "My App", "1.0")
2 Likes