0

I am using the apiDiscovery-1.0 feature in Liberty in order to expose the Swagger UI for my REST APIs. However, my REST APIs are secured using Basic Auth and the Authorize button is not being displayed in the UI exposed by the apiDiscovery feature in Liberty. Is this supported with the apiDiscovery feature?

The version of Liberty that I am using is as follows:

product = WebSphere Application Server 17.0.0.2 (wlp-1.0.17.cl170220170523-1818)

1 Answers1

0

If you are using annotations (JAXRS + Swagger v2), please note that you can only reference security definitions from within your annotated code - to actually declare them you will have to use a Swagger v2 stub document (inside META-INF/stub).

Check this sample.

In there we declare the security definition in the stub and then reference it from the annotation.

This is due to a limitation in the Swagger v2 annotation library that doesn't allow for security declarations from within annotations. This is something we're working to fix for OpenAPI v3.

ArthurDM
  • 403
  • 3
  • 6