Package org.eclipse.microprofile.openapi
Class OASFactory
java.lang.Object
org.eclipse.microprofile.openapi.OASFactory
This class allows application developers to build new OpenAPI model elements.
For example, to start a new top-level OpenAPI element with an ExternalDocument inside of it an application developer would write:
For example, to start a new top-level OpenAPI element with an ExternalDocument inside of it an application developer would write:
OASFactory.createObject(OpenAPI.class)
.setExternalDocs(OASFactory.createObject(ExternalDocumentation.class).url("http://myDoc"));
-
Method Summary
Modifier and TypeMethodDescriptionstatic APIResponse
This method creates a newAPIResponse
instance.static APIResponses
This method creates a newAPIResponses
instance.static Callback
This method creates a newCallback
instance.static Components
This method creates a newComponents
instance.static Contact
This method creates a newContact
instance.static Content
This method creates a newContent
instance.static Discriminator
This method creates a newDiscriminator
instance.static Encoding
This method creates a newEncoding
instance.static Example
This method creates a newExample
instance.static ExternalDocumentation
This method creates a newExternalDocumentation
instance.static Header
This method creates a newHeader
instance.static Info
This method creates a newInfo
instance.static License
This method creates a newLicense
instance.static Link
This method creates a newLink
instance.static MediaType
This method creates a newMediaType
instance.static OAuthFlow
This method creates a newOAuthFlow
instance.static OAuthFlows
This method creates a newOAuthFlows
instance.static <T extends Constructible>
TcreateObject
(Class<T> clazz) This method creates a new instance of a constructible element from the OpenAPI model tree.static OpenAPI
This method creates a newOpenAPI
instance.static Operation
This method creates a newOperation
instance.static Parameter
This method creates a newParameter
instance.static PathItem
This method creates a newPathItem
instance.static Paths
This method creates a newPaths
instance.static RequestBody
This method creates a newRequestBody
instance.static Schema
This method creates a newSchema
instance.static Scopes
This method creates a newScopes
instance.static SecurityRequirement
This method creates a newSecurityRequirement
instance.static SecurityScheme
This method creates a newSecurityScheme
instance.static Server
This method creates a newServer
instance.static ServerVariable
This method creates a newServerVariable
instance.static ServerVariables
Deprecated.static Tag
This method creates a newTag
instance.static XML
This method creates a newXML
instance.
-
Method Details
-
createObject
This method creates a new instance of a constructible element from the OpenAPI model tree.
Example:OASFactory.createObject(Info.class).title("Airlines").description("Airlines APIs").version("1.0.0");
- Type Parameters:
T
- describes the type parameter- Parameters:
clazz
- represents a model which extends theConstructible
interface- Returns:
- a new instance of the requested model class
- Throws:
NullPointerException
- if the specified class is nullIllegalArgumentException
- if an instance could not be created, most likely, due to an illegal or inappropriate class
-
createComponents
This method creates a newComponents
instance.- Returns:
- a new Components instance
-
createExternalDocumentation
This method creates a newExternalDocumentation
instance.- Returns:
- a new ExternalDocumentation instance
-
createOpenAPI
This method creates a newOpenAPI
instance.- Returns:
- a new OpenAPI instance
-
createOperation
This method creates a newOperation
instance.- Returns:
- a new Operation instance
-
createPathItem
This method creates a newPathItem
instance.- Returns:
- a new PathItem instance
-
createPaths
This method creates a newPaths
instance.- Returns:
- a new Paths instance
-
createCallback
This method creates a newCallback
instance.- Returns:
- a new Callback instance
-
createExample
This method creates a newExample
instance.- Returns:
- a new Example instance
-
createHeader
This method creates a newHeader
instance.- Returns:
- a new Header instance
-
createContact
This method creates a newContact
instance.- Returns:
- a new Contact instance
-
createInfo
This method creates a newInfo
instance.- Returns:
- a new Info instance
-
createLicense
This method creates a newLicense
instance.- Returns:
- a new License instance
-
createLink
This method creates a newLink
instance.- Returns:
- a new Link instance
-
createContent
This method creates a newContent
instance.- Returns:
- a new Content instance
-
createDiscriminator
This method creates a newDiscriminator
instance.- Returns:
- a new Discriminator instance
-
createEncoding
This method creates a newEncoding
instance.- Returns:
- a new Encoding instance
-
createMediaType
This method creates a newMediaType
instance.- Returns:
- a new MediaType instance
-
createSchema
This method creates a newSchema
instance.- Returns:
- a new Schema instance
-
createXML
This method creates a newXML
instance.- Returns:
- a new XML instance
-
createParameter
This method creates a newParameter
instance.- Returns:
- a new Parameter instance
-
createRequestBody
This method creates a newRequestBody
instance.- Returns:
- a new RequestBody instance
-
createAPIResponse
This method creates a newAPIResponse
instance.- Returns:
- a new APIResponse instance
-
createAPIResponses
This method creates a newAPIResponses
instance.- Returns:
- a new APIResponses instance
-
createOAuthFlow
This method creates a newOAuthFlow
instance.- Returns:
- a new OAuthFlow instance
-
createOAuthFlows
This method creates a newOAuthFlows
instance.- Returns:
- a new OAuthFlows instance
-
createScopes
This method creates a newScopes
instance.- Returns:
- a new Scopes instance
-
createSecurityRequirement
This method creates a newSecurityRequirement
instance.- Returns:
- a new SecurityRequirement instance
-
createSecurityScheme
This method creates a newSecurityScheme
instance.- Returns:
- a new SecurityScheme instance
-
createServer
This method creates a newServer
instance.- Returns:
- a new Server instance
-
createServerVariable
This method creates a newServerVariable
instance.- Returns:
- a new ServerVariable instance
-
createServerVariables
Deprecated.since 1.1, useMap<String, ServerVariable>
for server variables insteadThis method creates a newServerVariables
instance.- Returns:
- a new ServerVariables instance
-
createTag
This method creates a newTag
instance.- Returns:
- a new Tag instance
-
Map<String, ServerVariable>
for server variables instead