public class SwaggerBuilder extends Object
Constructor and Description |
---|
SwaggerBuilder() |
Modifier and Type | Method and Description |
---|---|
static Contact |
contact()
Creates an empty
Contact element. |
static Contact |
contact(String name)
|
static Contact |
contact(String name,
Object url,
String email)
|
static ExternalDocumentation |
externalDocumentation()
Creates an empty
ExternalDocumentation element. |
static ExternalDocumentation |
externalDocumentation(Object url)
Creates an
ExternalDocumentation element with the specified url
attribute. |
static ExternalDocumentation |
externalDocumentation(Object url,
String description)
|
static HeaderInfo |
headerInfo()
Creates an empty
HeaderInfo element. |
static HeaderInfo |
headerInfo(String type)
Creates an
HeaderInfo element with the specified type attribute. |
static HeaderInfo |
headerInfoStrict(String type)
Creates an
HeaderInfo element with the specified type attribute. |
static Info |
info()
Creates an empty
Info element. |
static Info |
info(String title,
String version)
|
static Items |
items()
Creates an empty
Items element. |
static Items |
items(String type)
|
static Items |
itemsStrict(String type)
|
static License |
license()
Creates an empty
License element. |
static License |
license(String name)
|
static License |
license(String name,
URI url)
|
static Operation |
operation()
Creates an empty
Operation element. |
static ParameterInfo |
parameterInfo()
Creates an empty
ParameterInfo element. |
static ParameterInfo |
parameterInfo(String in,
String name)
|
static ParameterInfo |
parameterInfoStrict(String in,
String name)
|
static ResponseInfo |
responseInfo()
Creates an empty
ResponseInfo element. |
static ResponseInfo |
responseInfo(String description)
Creates an
ResponseInfo element with the specified description attribute. |
static SchemaInfo |
schemaInfo()
Creates an empty
SchemaInfo element. |
static SecurityScheme |
securityScheme()
Creates an empty
SecurityScheme element. |
static SecurityScheme |
securityScheme(String type)
Creates an
SecurityScheme element with the specified type attribute. |
static SecurityScheme |
securitySchemeStrict(String type)
Creates an
SecurityScheme element with the specified type attribute. |
static Swagger |
swagger()
Creates an empty
Swagger element. |
static Swagger |
swagger(Info info)
|
static Tag |
tag()
Creates an empty
Tag element. |
static Tag |
tag(String name)
|
static Xml |
xml()
Creates an empty
Xml element. |
public SwaggerBuilder()
public static final Contact contact()
Contact
element.public static final Contact contact(String name)
name
- The name
attribute.public static final ExternalDocumentation externalDocumentation()
ExternalDocumentation
element.public static final ExternalDocumentation externalDocumentation(Object url)
ExternalDocumentation
element with the specified url
attribute.url
- The url
attribute.
URI
, URL
, String
.
UriResolver
can be used for values.public static final ExternalDocumentation externalDocumentation(Object url, String description)
url
- The url
attribute.
URI
, URL
, String
.
UriResolver
can be used for values.description
- The description
attribute.public static final HeaderInfo headerInfo()
HeaderInfo
element.public static final HeaderInfo headerInfo(String type)
HeaderInfo
element with the specified type
attribute.type
- The type
attribute.public static final HeaderInfo headerInfoStrict(String type)
HeaderInfo
element with the specified type
attribute.
Throws a runtime exception if the type is not valid.
type
- The type
attribute.
public static final Items items(String type)
type
- The type
attribute.public static final Items itemsStrict(String type)
Items
element with the specified type
attribute.
Throws a runtime exception if the type is not valid.
type
- The type
attribute.
public static final License license()
License
element.public static final License license(String name)
name
- The name
attribute.public static final Operation operation()
Operation
element.public static final ParameterInfo parameterInfo()
ParameterInfo
element.public static final ParameterInfo parameterInfo(String in, String name)
public static final ParameterInfo parameterInfoStrict(String in, String name)
ParameterInfo
element with the specified in
and
name
attributes.
Throws a runtime exception if the type is not valid.
public static final ResponseInfo responseInfo()
ResponseInfo
element.public static final ResponseInfo responseInfo(String description)
ResponseInfo
element with the specified description
attribute.description
- The description
attribute.public static final SchemaInfo schemaInfo()
SchemaInfo
element.public static final SecurityScheme securityScheme()
SecurityScheme
element.public static final SecurityScheme securityScheme(String type)
SecurityScheme
element with the specified type
attribute.type
- The type
attribute.public static final SecurityScheme securitySchemeStrict(String type)
SecurityScheme
element with the specified type
attribute.
Throws a runtime exception if the type is not valid.
type
- The type
attribute.
public static final Swagger swagger()
Swagger
element.public static final Swagger swagger(Info info)
info
- The info
attribute.public static final Tag tag(String name)
name
- The name
attribute.Copyright © 2018 Apache. All rights reserved.