Package org.eclipse.microprofile.openapi
Class OASFactory
- java.lang.Object
-
- org.eclipse.microprofile.openapi.OASFactory
-
public final class OASFactory extends 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 Modifier and Type Method Description static APIResponsecreateAPIResponse()This method creates a newAPIResponseinstance.static APIResponsescreateAPIResponses()This method creates a newAPIResponsesinstance.static CallbackcreateCallback()This method creates a newCallbackinstance.static ComponentscreateComponents()This method creates a newComponentsinstance.static ContactcreateContact()This method creates a newContactinstance.static ContentcreateContent()This method creates a newContentinstance.static DiscriminatorcreateDiscriminator()This method creates a newDiscriminatorinstance.static EncodingcreateEncoding()This method creates a newEncodinginstance.static ExamplecreateExample()This method creates a newExampleinstance.static ExternalDocumentationcreateExternalDocumentation()This method creates a newExternalDocumentationinstance.static HeadercreateHeader()This method creates a newHeaderinstance.static InfocreateInfo()This method creates a newInfoinstance.static LicensecreateLicense()This method creates a newLicenseinstance.static LinkcreateLink()This method creates a newLinkinstance.static MediaTypecreateMediaType()This method creates a newMediaTypeinstance.static OAuthFlowcreateOAuthFlow()This method creates a newOAuthFlowinstance.static OAuthFlowscreateOAuthFlows()This method creates a newOAuthFlowsinstance.static <T extends Constructible>
TcreateObject(Class<T> clazz)This method creates a new instance of a constructible element from the OpenAPI model tree.static OpenAPIcreateOpenAPI()This method creates a newOpenAPIinstance.static OperationcreateOperation()This method creates a newOperationinstance.static ParametercreateParameter()This method creates a newParameterinstance.static PathItemcreatePathItem()This method creates a newPathIteminstance.static PathscreatePaths()This method creates a newPathsinstance.static RequestBodycreateRequestBody()This method creates a newRequestBodyinstance.static SchemacreateSchema()This method creates a newSchemainstance.static SecurityRequirementcreateSecurityRequirement()This method creates a newSecurityRequirementinstance.static SecuritySchemecreateSecurityScheme()This method creates a newSecuritySchemeinstance.static ServercreateServer()This method creates a newServerinstance.static ServerVariablecreateServerVariable()This method creates a newServerVariableinstance.static TagcreateTag()This method creates a newTaginstance.static XMLcreateXML()This method creates a newXMLinstance.
-
-
-
Method Detail
-
createObject
public static <T extends Constructible> T createObject(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 theConstructibleinterface- 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
public static Components createComponents()
This method creates a newComponentsinstance.- Returns:
- a new Components instance
-
createExternalDocumentation
public static ExternalDocumentation createExternalDocumentation()
This method creates a newExternalDocumentationinstance.- Returns:
- a new ExternalDocumentation instance
-
createOpenAPI
public static OpenAPI createOpenAPI()
This method creates a newOpenAPIinstance.- Returns:
- a new OpenAPI instance
-
createOperation
public static Operation createOperation()
This method creates a newOperationinstance.- Returns:
- a new Operation instance
-
createPathItem
public static PathItem createPathItem()
This method creates a newPathIteminstance.- Returns:
- a new PathItem instance
-
createPaths
public static Paths createPaths()
This method creates a newPathsinstance.- Returns:
- a new Paths instance
-
createCallback
public static Callback createCallback()
This method creates a newCallbackinstance.- Returns:
- a new Callback instance
-
createExample
public static Example createExample()
This method creates a newExampleinstance.- Returns:
- a new Example instance
-
createHeader
public static Header createHeader()
This method creates a newHeaderinstance.- Returns:
- a new Header instance
-
createContact
public static Contact createContact()
This method creates a newContactinstance.- Returns:
- a new Contact instance
-
createInfo
public static Info createInfo()
This method creates a newInfoinstance.- Returns:
- a new Info instance
-
createLicense
public static License createLicense()
This method creates a newLicenseinstance.- Returns:
- a new License instance
-
createLink
public static Link createLink()
This method creates a newLinkinstance.- Returns:
- a new Link instance
-
createContent
public static Content createContent()
This method creates a newContentinstance.- Returns:
- a new Content instance
-
createDiscriminator
public static Discriminator createDiscriminator()
This method creates a newDiscriminatorinstance.- Returns:
- a new Discriminator instance
-
createEncoding
public static Encoding createEncoding()
This method creates a newEncodinginstance.- Returns:
- a new Encoding instance
-
createMediaType
public static MediaType createMediaType()
This method creates a newMediaTypeinstance.- Returns:
- a new MediaType instance
-
createSchema
public static Schema createSchema()
This method creates a newSchemainstance.- Returns:
- a new Schema instance
-
createXML
public static XML createXML()
This method creates a newXMLinstance.- Returns:
- a new XML instance
-
createParameter
public static Parameter createParameter()
This method creates a newParameterinstance.- Returns:
- a new Parameter instance
-
createRequestBody
public static RequestBody createRequestBody()
This method creates a newRequestBodyinstance.- Returns:
- a new RequestBody instance
-
createAPIResponse
public static APIResponse createAPIResponse()
This method creates a newAPIResponseinstance.- Returns:
- a new APIResponse instance
-
createAPIResponses
public static APIResponses createAPIResponses()
This method creates a newAPIResponsesinstance.- Returns:
- a new APIResponses instance
-
createOAuthFlow
public static OAuthFlow createOAuthFlow()
This method creates a newOAuthFlowinstance.- Returns:
- a new OAuthFlow instance
-
createOAuthFlows
public static OAuthFlows createOAuthFlows()
This method creates a newOAuthFlowsinstance.- Returns:
- a new OAuthFlows instance
-
createSecurityRequirement
public static SecurityRequirement createSecurityRequirement()
This method creates a newSecurityRequirementinstance.- Returns:
- a new SecurityRequirement instance
-
createSecurityScheme
public static SecurityScheme createSecurityScheme()
This method creates a newSecuritySchemeinstance.- Returns:
- a new SecurityScheme instance
-
createServer
public static Server createServer()
This method creates a newServerinstance.- Returns:
- a new Server instance
-
createServerVariable
public static ServerVariable createServerVariable()
This method creates a newServerVariableinstance.- Returns:
- a new ServerVariable instance
-
-