Configures the settings of the MicroProfile OpenAPI service.


asadmin [asadmin-options] set-openapi-configuration [--help]


This command enables or disables the OpenAPI service.

When the OpenAPI service is disabled, the /openapi endpoint will always return a 403 error and any applications deployed during this period will not have an OpenAPI document built.
Enabling the service again will not cause a documents to be built for any currently deployed applications.



Options for the asadmin utility. For information about these options, see the asadmin help page.


Displays the help text for the subcommand.


Whether the service should be enabled/disabled. Defaults to true.


Defaults to false. Whether CORS protection headers (e.g. Access-Control-Allow-Origin=*) should be added to OpenAPI endpoint responses.


Defaults to false. Whether to secure access to the OpenAPI endpoint is enabled.


Defaults to microprofile.

If defined, the endpoint will be assigned to a list of the role specified as a comma-separated.


Defaults to openapi. The context root used to expose the OpenAPI endpoint.


Specifies the target of this command.
Valid values are as follows:


Specifies the DAS (default).


Specifies a Payara Server instance.


Specifies a cluster.


Specifies a named configuration.


If defined, the /openapi endpoint will be assigned to the list of virtual servers specified as a comma-separated list of names.

Otherwise, the endpoint will be assigned to all virtual servers available.


Example 1 Configures OpenAPI service

This example configures OpenAPI service with CORS headers enabled, security enabled, a custom endpoint context root, and association with the specified virtual servers.

asadmin set-openapi-configuration --enabled=true --corsHeaders=true --securityEnabled=true --roles=ADMIN --endpoint=myapi --target=server --virtualservers=myapp

Exit Status


subcommand executed successfully


error in executing the subcommand

See Also