Package org.eclipse.microprofile.openapi
Class OASFactory
- java.lang.Object
-
- org.eclipse.microprofile.openapi.OASFactory
-
public final class OASFactory extends java.lang.Object
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:OASFactory.createObject(OpenAPI.class) .setExternalDocs(OASFactory.createObject(ExternalDocumentation.class).url("http://myDoc"));
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static APIResponse
createAPIResponse()
This method creates a newAPIResponse
instance.static APIResponses
createAPIResponses()
This method creates a newAPIResponses
instance.static Callback
createCallback()
This method creates a newCallback
instance.static Components
createComponents()
This method creates a newComponents
instance.static Contact
createContact()
This method creates a newContact
instance.static Content
createContent()
This method creates a newContent
instance.static Discriminator
createDiscriminator()
This method creates a newDiscriminator
instance.static Encoding
createEncoding()
This method creates a newEncoding
instance.static Example
createExample()
This method creates a newExample
instance.static ExternalDocumentation
createExternalDocumentation()
This method creates a newExternalDocumentation
instance.static Header
createHeader()
This method creates a newHeader
instance.static Info
createInfo()
This method creates a newInfo
instance.static License
createLicense()
This method creates a newLicense
instance.static Link
createLink()
This method creates a newLink
instance.static MediaType
createMediaType()
This method creates a newMediaType
instance.static OAuthFlow
createOAuthFlow()
This method creates a newOAuthFlow
instance.static OAuthFlows
createOAuthFlows()
This method creates a newOAuthFlows
instance.static <T extends Constructible>
TcreateObject(java.lang.Class<T> clazz)
This method creates a new instance of a constructible element from the OpenAPI model tree.static OpenAPI
createOpenAPI()
This method creates a newOpenAPI
instance.static Operation
createOperation()
This method creates a newOperation
instance.static Parameter
createParameter()
This method creates a newParameter
instance.static PathItem
createPathItem()
This method creates a newPathItem
instance.static Paths
createPaths()
This method creates a newPaths
instance.static RequestBody
createRequestBody()
This method creates a newRequestBody
instance.static Schema
createSchema()
This method creates a newSchema
instance.static Scopes
createScopes()
This method creates a newScopes
instance.static SecurityRequirement
createSecurityRequirement()
This method creates a newSecurityRequirement
instance.static SecurityScheme
createSecurityScheme()
This method creates a newSecurityScheme
instance.static Server
createServer()
This method creates a newServer
instance.static ServerVariable
createServerVariable()
This method creates a newServerVariable
instance.static ServerVariables
createServerVariables()
Deprecated.since 1.1, useMap<String, ServerVariable>
for server variables insteadstatic Tag
createTag()
This method creates a newTag
instance.static XML
createXML()
This method creates a newXML
instance.
-
-
-
Method Detail
-
createObject
public static <T extends Constructible> T createObject(java.lang.Class<T> clazz)
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:
java.lang.NullPointerException
- if the specified class is nulljava.lang.IllegalArgumentException
- if an instance could not be created, most likely, due to an illegal or inappropriate class
-
createComponents
public static Components createComponents()
This method creates a newComponents
instance.- Returns:
- a new Components instance
-
createExternalDocumentation
public static ExternalDocumentation createExternalDocumentation()
This method creates a newExternalDocumentation
instance.- Returns:
- a new ExternalDocumentation instance
-
createOpenAPI
public static OpenAPI createOpenAPI()
This method creates a newOpenAPI
instance.- Returns:
- a new OpenAPI instance
-
createOperation
public static Operation createOperation()
This method creates a newOperation
instance.- Returns:
- a new Operation instance
-
createPathItem
public static PathItem createPathItem()
This method creates a newPathItem
instance.- Returns:
- a new PathItem instance
-
createPaths
public static Paths createPaths()
This method creates a newPaths
instance.- Returns:
- a new Paths instance
-
createCallback
public static Callback createCallback()
This method creates a newCallback
instance.- Returns:
- a new Callback instance
-
createExample
public static Example createExample()
This method creates a newExample
instance.- Returns:
- a new Example instance
-
createHeader
public static Header createHeader()
This method creates a newHeader
instance.- Returns:
- a new Header instance
-
createContact
public static Contact createContact()
This method creates a newContact
instance.- Returns:
- a new Contact instance
-
createInfo
public static Info createInfo()
This method creates a newInfo
instance.- Returns:
- a new Info instance
-
createLicense
public static License createLicense()
This method creates a newLicense
instance.- Returns:
- a new License instance
-
createLink
public static Link createLink()
This method creates a newLink
instance.- Returns:
- a new Link instance
-
createContent
public static Content createContent()
This method creates a newContent
instance.- Returns:
- a new Content instance
-
createDiscriminator
public static Discriminator createDiscriminator()
This method creates a newDiscriminator
instance.- Returns:
- a new Discriminator instance
-
createEncoding
public static Encoding createEncoding()
This method creates a newEncoding
instance.- Returns:
- a new Encoding instance
-
createMediaType
public static MediaType createMediaType()
This method creates a newMediaType
instance.- Returns:
- a new MediaType instance
-
createSchema
public static Schema createSchema()
This method creates a newSchema
instance.- Returns:
- a new Schema instance
-
createXML
public static XML createXML()
This method creates a newXML
instance.- Returns:
- a new XML instance
-
createParameter
public static Parameter createParameter()
This method creates a newParameter
instance.- Returns:
- a new Parameter instance
-
createRequestBody
public static RequestBody createRequestBody()
This method creates a newRequestBody
instance.- Returns:
- a new RequestBody instance
-
createAPIResponse
public static APIResponse createAPIResponse()
This method creates a newAPIResponse
instance.- Returns:
- a new APIResponse instance
-
createAPIResponses
public static APIResponses createAPIResponses()
This method creates a newAPIResponses
instance.- Returns:
- a new APIResponses instance
-
createOAuthFlow
public static OAuthFlow createOAuthFlow()
This method creates a newOAuthFlow
instance.- Returns:
- a new OAuthFlow instance
-
createOAuthFlows
public static OAuthFlows createOAuthFlows()
This method creates a newOAuthFlows
instance.- Returns:
- a new OAuthFlows instance
-
createScopes
public static Scopes createScopes()
This method creates a newScopes
instance.- Returns:
- a new Scopes instance
-
createSecurityRequirement
public static SecurityRequirement createSecurityRequirement()
This method creates a newSecurityRequirement
instance.- Returns:
- a new SecurityRequirement instance
-
createSecurityScheme
public static SecurityScheme createSecurityScheme()
This method creates a newSecurityScheme
instance.- Returns:
- a new SecurityScheme instance
-
createServer
public static Server createServer()
This method creates a newServer
instance.- Returns:
- a new Server instance
-
createServerVariable
public static ServerVariable createServerVariable()
This method creates a newServerVariable
instance.- Returns:
- a new ServerVariable instance
-
createServerVariables
@Deprecated public static ServerVariables createServerVariables()
Deprecated.since 1.1, useMap<String, ServerVariable>
for server variables insteadThis method creates a newServerVariables
instance.- Returns:
- a new ServerVariables instance
-
-