I have a war with MicroProfile OpenApi annotations. When I run it on Payara or OpenLiberty, I can access the OpenApi document at http://localhost:8080/openapi, as specified in the spec.
This does not work on WildFly 18 nor on 19 Beta 1, even though it claims to support MP OpenApi. I suppose the TCK would check for that, so maybe I'm doing something wrong.
It looks like the OpenAPI support was added with WildFly 19 Beta 1. Unfortunately, the current documentation on the wildfly.org page is for WildFly 18 and does not include an admin guide for including OpenAPI.
Nevertheless, you can find the .adoc
file for the OpenAPI support on GitHub. Based on the history of this file, it was added in December 2019 (that's maybe why I didn't make its way to the documentation on the homepage yet).
The current documentation for OpenAPI claims to be part of the default standalone-microprofile.xml
configuration and the document is available at http://localhost:8080.
If you don't run with this configuration, you can enable the OpenAPI subsystem with the following commands (which I tested with WildFly 19 Beta 1):
➜ bin ./jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
[standalone@localhost:9990 /] /extension=org.wildfly.extension.microprofile.openapi-smallrye:add()
{"outcome" => "success"}
[standalone@localhost:9990 /] /subsystem=microprofile-openapi-smallrye:add()
{
"outcome" => "success",
"response-headers" => {
"operation-requires-reload" => true,
"process-state" => "reload-required"
}
}
[standalone@localhost:9990 /]
Please note: If you then try to access it at http://localhost:8080/openapi in your browser, you might get a 406 - Not Acceptable. Just request it the correct content-type or using cURL
:
curl -v http://localhost:8080/openapi // YAML output
curl -v http://localhost:8080/openapi?format=JSON // JSON output
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments