Package io.helidon.openapi
Class OpenAPISupport
- java.lang.Object
-
- io.helidon.openapi.OpenAPISupport
-
- All Implemented Interfaces:
Service
public class OpenAPISupport extends Object implements Service
Provides an endpoint and supporting logic for returning an OpenAPI document that describes the endpoints handled by the server.The server can use the
OpenAPISupport.Builderto set OpenAPI-related attributes. If the server uses none of these builder methods and does not provide a staticopenapifile, then the/openapiendpoint responds with a nearly-empty OpenAPI document.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpenAPISupport.BuilderFluent API builder forOpenAPISupport.
-
Field Summary
Fields Modifier and Type Field Description static MediaTypeDEFAULT_RESPONSE_MEDIA_TYPEDefault media type used in responses in absence of incoming Accept header.static StringDEFAULT_WEB_CONTEXTDefault path for serving the OpenAPI document.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OpenAPISupport.Builderbuilder()Creates a newOpenAPISupport.BuilderforOpenAPISupportusing defaults.voidconfigureEndpoint(Routing.Rules rules)Sets up the OpenAPI endpoint by adding routing to the specified rules set.static OpenAPISupportcreate()Creates a newOpenAPISupportinstance using defaults.static OpenAPISupportcreate(Config config)Creates a newOpenAPISupportinstance using the 'openapi' portion of the providedConfigobject.voidupdate(Routing.Rules rules)UpdatesRouting.Ruleswithhandlersrepresenting this service.
-
-
-
Field Detail
-
DEFAULT_WEB_CONTEXT
public static final String DEFAULT_WEB_CONTEXT
Default path for serving the OpenAPI document.- See Also:
- Constant Field Values
-
DEFAULT_RESPONSE_MEDIA_TYPE
public static final MediaType DEFAULT_RESPONSE_MEDIA_TYPE
Default media type used in responses in absence of incoming Accept header.
-
-
Method Detail
-
update
public void update(Routing.Rules rules)
Description copied from interface:ServiceUpdatesRouting.Ruleswithhandlersrepresenting this service.
-
configureEndpoint
public void configureEndpoint(Routing.Rules rules)
Sets up the OpenAPI endpoint by adding routing to the specified rules set.- Parameters:
rules- routing rules to be augmented with OpenAPI endpoint
-
builder
public static OpenAPISupport.Builder builder()
Creates a newOpenAPISupport.BuilderforOpenAPISupportusing defaults.- Returns:
- new Builder
-
create
public static OpenAPISupport create()
Creates a newOpenAPISupportinstance using defaults.- Returns:
- new OpenAPISUpport
-
create
public static OpenAPISupport create(Config config)
Creates a newOpenAPISupportinstance using the 'openapi' portion of the providedConfigobject.- Parameters:
config-Configobject containing OpenAPI-related settings- Returns:
- new
OpenAPISupportinstance created using the helidonConfig settings
-
-