Package org.apache.juneau.dto.swagger
Class SwaggerBuilder
java.lang.Object
org.apache.juneau.dto.swagger.SwaggerBuilder
Various useful static methods for creating Swagger elements.
See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final Contact
contact()
Creates an emptyContact
element.static final Contact
static final Contact
static final ExternalDocumentation
Creates an emptyExternalDocumentation
element.static final ExternalDocumentation
Creates anExternalDocumentation
element with the specifiedurl
attribute.static final ExternalDocumentation
externalDocumentation
(Object url, String description) static final HeaderInfo
Creates an emptyHeaderInfo
element.static final HeaderInfo
headerInfo
(String type) Creates anHeaderInfo
element with the specifiedtype
attribute.static final HeaderInfo
headerInfoStrict
(String type) Creates anHeaderInfo
element with the specifiedtype
attribute.static final Info
info()
Creates an emptyInfo
element.static final Info
static final Items
items()
Creates an emptyItems
element.static final Items
static final Items
itemsStrict
(String type) static final License
license()
Creates an emptyLicense
element.static final License
static final License
static final Operation
Creates an emptyOperation
element.static final ParameterInfo
Creates an emptyParameterInfo
element.static final ParameterInfo
parameterInfo
(String in, String name) static final ParameterInfo
parameterInfoStrict
(String in, String name) static final ResponseInfo
Creates an emptyResponseInfo
element.static final ResponseInfo
responseInfo
(String description) Creates anResponseInfo
element with the specifieddescription
attribute.static final SchemaInfo
Creates an emptySchemaInfo
element.static final SecurityScheme
Creates an emptySecurityScheme
element.static final SecurityScheme
securityScheme
(String type) Creates anSecurityScheme
element with the specifiedtype
attribute.static final SecurityScheme
securitySchemeStrict
(String type) Creates anSecurityScheme
element with the specifiedtype
attribute.static final Swagger
swagger()
Creates an emptySwagger
element.static final Swagger
static final Tag
tag()
Creates an emptyTag
element.static final Tag
static final Xml
xml()
Creates an emptyXml
element.
-
Constructor Details
-
SwaggerBuilder
public SwaggerBuilder()
-
-
Method Details
-
contact
Creates an emptyContact
element.- Returns:
- The new element.
-
contact
- Parameters:
name
- Thename
attribute.- Returns:
- The new element.
-
contact
-
externalDocumentation
Creates an emptyExternalDocumentation
element.- Returns:
- The new element.
-
externalDocumentation
Creates anExternalDocumentation
element with the specifiedurl
attribute.- Parameters:
url
- Theurl
attribute.
The value can be of any of the following types:URI
,URL
,String
.
Strings must be valid URIs.
URIs defined byUriResolver
can be used for values.- Returns:
- The new element.
-
externalDocumentation
- Parameters:
url
- Theurl
attribute.
The value can be of any of the following types:URI
,URL
,String
.
Strings must be valid URIs.
URIs defined byUriResolver
can be used for values.description
- Thedescription
attribute.- Returns:
- The new element.
-
headerInfo
Creates an emptyHeaderInfo
element.- Returns:
- The new element.
-
headerInfo
Creates anHeaderInfo
element with the specifiedtype
attribute.- Parameters:
type
- Thetype
attribute.- Returns:
- The new element.
-
headerInfoStrict
Creates anHeaderInfo
element with the specifiedtype
attribute.Throws a runtime exception if the type is not valid.
- Parameters:
type
- Thetype
attribute.
Valid values:"string" "number" "integer" "boolean" "array"
- Returns:
- The new element.
-
info
Creates an emptyInfo
element.- Returns:
- The new element.
-
info
-
items
Creates an emptyItems
element.- Returns:
- The new element.
-
items
- Parameters:
type
- Thetype
attribute.- Returns:
- The new element.
-
itemsStrict
Creates anItems
element with the specifiedtype
attribute.Throws a runtime exception if the type is not valid.
- Parameters:
type
- Thetype
attribute.
Valid values:"string" "number" "integer" "boolean" "array"
- Returns:
- The new element.
-
license
Creates an emptyLicense
element.- Returns:
- The new element.
-
license
- Parameters:
name
- Thename
attribute.- Returns:
- The new element.
-
license
-
operation
Creates an emptyOperation
element.- Returns:
- The new element.
-
parameterInfo
Creates an emptyParameterInfo
element.- Returns:
- The new element.
-
parameterInfo
-
parameterInfoStrict
Creates anParameterInfo
element with the specifiedin
andname
attributes.Throws a runtime exception if the type is not valid.
-
responseInfo
Creates an emptyResponseInfo
element.- Returns:
- The new element.
-
responseInfo
Creates anResponseInfo
element with the specifieddescription
attribute.- Parameters:
description
- Thedescription
attribute.- Returns:
- The new element.
-
schemaInfo
Creates an emptySchemaInfo
element.- Returns:
- The new element.
-
securityScheme
Creates an emptySecurityScheme
element.- Returns:
- The new element.
-
securityScheme
Creates anSecurityScheme
element with the specifiedtype
attribute.- Parameters:
type
- Thetype
attribute.- Returns:
- The new element.
-
securitySchemeStrict
Creates anSecurityScheme
element with the specifiedtype
attribute.Throws a runtime exception if the type is not valid.
- Parameters:
type
- Thetype
attribute.
Valid values:"basic" "apiKey" "oauth2"
- Returns:
- The new element.
-
swagger
Creates an emptySwagger
element.- Returns:
- The new element.
-
swagger
- Parameters:
info
- Theinfo
attribute.- Returns:
- The new element.
-
tag
Creates an emptyTag
element.- Returns:
- The new element.
-
tag
- Parameters:
name
- Thename
attribute.- Returns:
- The new element.
-
xml
Creates an emptyXml
element.- Returns:
- The new element.
-