@Bean(properties="in,name,type,description,required,schema,format,allowEmptyValue,items,collectionFormat,default,maximum,exclusiveMaximum,minimum,exclusiveMinimum,maxLength,minLength,pattern,maxItems,minItems,uniqueItems,enum,multipleOf,*") public class ParameterInfo extends SwaggerElement
A unique parameter is defined by a combination of a name and location.
There are five possible parameter types.
/items/{itemId}
, the path parameter is itemId
.
/items?id=###
, the query parameter is id
.
application/x-www-form-urlencoded
, multipart/form-data
or both are used as the
content type of the request (in Swagger's definition, the consumes property of an operation).
This is the only parameter type that can be used to send files, thus supporting the file type.
Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the
same operation.
Form parameters have a different format based on the content-type used (for further details, consult
http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4
):
foo=1&bar=swagger
- both foo
and bar
are form
parameters.
This is normally used for simple parameters that are being transferred.
Content-Disposition: form-data; name="submit-name"
the name of
the parameter is submit-name
.
This type of form parameters is more commonly used for file transfers.
Constructor and Description |
---|
ParameterInfo() |
Modifier and Type | Method and Description |
---|---|
ParameterInfo |
_default(Object value)
Same as
setDefault(Object) . |
ParameterInfo |
_enum(Object... values)
Adds one or more values to the
|
ParameterInfo |
addEnum(Collection<Object> value)
Adds one or more values to the
|
ParameterInfo |
allowEmptyValue(Object value)
Same as
setAllowEmptyValue(Boolean) . |
ParameterInfo |
collectionFormat(Object value)
Same as
setCollectionFormat(String) . |
ParameterInfo |
copyFrom(ParameterInfo p)
Copies any non-null fields from the specified object to this object.
|
ParameterInfo |
description(Object value)
Same as
setDescription(String) . |
ParameterInfo |
exclusiveMaximum(Object value)
Same as
setExclusiveMaximum(Boolean) . |
ParameterInfo |
exclusiveMinimum(Object value)
Same as
setExclusiveMinimum(Boolean) . |
ParameterInfo |
format(Object value)
Same as
setFormat(String) . |
<T> T |
get(String property,
Class<T> type)
Generic property getter.
|
Boolean |
getAllowEmptyValue()
Bean property getter:
|
String |
getCollectionFormat()
Bean property getter:
|
Object |
getDefault()
Bean property getter:
|
String |
getDescription()
Bean property getter:
|
List<Object> |
getEnum()
Bean property getter:
|
Boolean |
getExclusiveMaximum()
Bean property getter:
|
Boolean |
getExclusiveMinimum()
Bean property getter:
|
String |
getFormat()
Bean property getter:
|
String |
getIn()
Bean property getter:
|
Items |
getItems()
Bean property getter:
|
Number |
getMaximum()
Bean property getter:
|
Integer |
getMaxItems()
Bean property getter:
|
Integer |
getMaxLength()
Bean property getter:
|
Number |
getMinimum()
Bean property getter:
|
Integer |
getMinItems()
Bean property getter:
|
Integer |
getMinLength()
Bean property getter:
|
Number |
getMultipleOf()
Bean property getter:
|
String |
getName()
Bean property getter:
|
String |
getPattern()
Bean property getter:
|
Boolean |
getRequired()
Bean property getter:
|
SchemaInfo |
getSchema()
Bean property getter:
|
String |
getType()
Bean property getter:
|
Boolean |
getUniqueItems()
Bean property getter:
|
ParameterInfo |
in(Object value)
Same as
setIn(String) . |
ParameterInfo |
items(Object value)
Same as
setItems(Items) . |
ParameterInfo |
maximum(Object value)
Same as
setMaximum(Number) . |
ParameterInfo |
maxItems(Object value)
Same as
setMaxItems(Integer) . |
ParameterInfo |
maxLength(Object value)
Same as
setMaxLength(Integer) . |
ParameterInfo |
minimum(Object value)
Same as
setMinimum(Number) . |
ParameterInfo |
minItems(Object value)
Same as
setMinItems(Integer) . |
ParameterInfo |
minLength(Object value)
Same as
setMinLength(Integer) . |
ParameterInfo |
multipleOf(Object value)
Same as
setMultipleOf(Number) . |
ParameterInfo |
name(Object value)
Same as
setName(String) . |
ParameterInfo |
pattern(Object value)
Same as
setPattern(String) . |
ParameterInfo |
required(Object value)
Same as
setRequired(Boolean) . |
ParameterInfo |
schema(Object value)
Same as
setSchema(SchemaInfo) . |
ParameterInfo |
set(String property,
Object value)
Generic property setter.
|
ParameterInfo |
setAllowEmptyValue(Boolean value)
Bean property setter:
|
ParameterInfo |
setCollectionFormat(String value)
Bean property setter:
|
ParameterInfo |
setDefault(Object value)
Bean property setter:
|
ParameterInfo |
setDescription(String value)
Bean property setter:
|
ParameterInfo |
setEnum(Collection<Object> value)
Bean property setter:
|
ParameterInfo |
setExclusiveMaximum(Boolean value)
Bean property setter:
|
ParameterInfo |
setExclusiveMinimum(Boolean value)
Bean property setter:
|
ParameterInfo |
setFormat(String value)
Bean property setter:
|
ParameterInfo |
setIn(String value)
Bean property setter:
|
ParameterInfo |
setItems(Items value)
Bean property setter:
|
ParameterInfo |
setMaximum(Number value)
Bean property setter:
|
ParameterInfo |
setMaxItems(Integer value)
Bean property setter:
|
ParameterInfo |
setMaxLength(Integer value)
Bean property setter:
|
ParameterInfo |
setMinimum(Number value)
Bean property setter:
|
ParameterInfo |
setMinItems(Integer value)
Bean property setter:
|
ParameterInfo |
setMinLength(Integer value)
Bean property setter:
|
ParameterInfo |
setMultipleOf(Number value)
Bean property setter:
|
ParameterInfo |
setName(String value)
Bean property setter:
|
ParameterInfo |
setPattern(String value)
Bean property setter:
|
ParameterInfo |
setRequired(Boolean value)
Bean property setter:
|
ParameterInfo |
setSchema(SchemaInfo value)
Bean property setter:
|
ParameterInfo |
setType(String value)
Bean property setter:
|
ParameterInfo |
setUniqueItems(Boolean value)
Bean property setter:
|
protected ParameterInfo |
strict()
Sets strict mode on this bean.
|
ParameterInfo |
type(Object value)
Same as
setType(String) . |
ParameterInfo |
uniqueItems(Object value)
Same as
setUniqueItems(Boolean) . |
getExtraProperties, isStrict, strict, toString
public ParameterInfo()
protected ParameterInfo strict()
SwaggerElement
strict
in class SwaggerElement
public ParameterInfo copyFrom(ParameterInfo p)
p
- The object to copy fields from.
public String getName()
The name of the parameter.
in
is name
field MUST correspond to the associated path segment
from the path
field in the Paths Object.
in
property.
public ParameterInfo setName(String value)
The name of the parameter.
in
is name
field MUST correspond to the associated path segment
from the path
field in the Paths Object.
in
property.
value
- The new value for this property.
public ParameterInfo name(Object value)
setName(String)
.value
- The new value for this property.
toString()
.
public String getIn()
The location of the parameter.
public ParameterInfo setIn(String value)
The location of the parameter.
value
- The new value for this property.
public ParameterInfo in(Object value)
setIn(String)
.value
- The new value for this property.
toString()
.
public String getDescription()
A brief description of the parameter.
This could contain examples of use.
public ParameterInfo setDescription(String value)
A brief description of the parameter.
This could contain examples of use.
value
- The new value for this property.
public ParameterInfo description(Object value)
setDescription(String)
.value
- The new value for this property.
toString()
.
public Boolean getRequired()
Determines whether this parameter is mandatory.
public ParameterInfo setRequired(Boolean value)
Determines whether this parameter is mandatory.
value
- The new value for this property.
in
public ParameterInfo required(Object value)
setRequired(Boolean)
.value
- The new value for this property.
Boolean.valueOf (value.toString())
.
in
public SchemaInfo getSchema()
The schema defining the type used for the body parameter.
public ParameterInfo setSchema(SchemaInfo value)
The schema defining the type used for the body parameter.
value
- The new value for this property.
public ParameterInfo schema(Object value)
setSchema(SchemaInfo)
.value
- The new value for this property.
SchemaInfo
String
- JSON object representation of SchemaInfo
schema(
public String getType()
The type of the parameter.
public ParameterInfo setType(String value)
The type of the parameter.
value
- The new value for this property.
consumes
MUST be either in
public ParameterInfo type(Object value)
setType(String)
.value
- The new value for this property.
toString()
.
consumes
MUST be either in
public String getFormat()
The extending format for the previously mentioned type.
public ParameterInfo setFormat(String value)
The extending format for the previously mentioned type.
value
- The new value for this property.public ParameterInfo format(Object value)
setFormat(String)
.value
- The new value for this property.
toString()
.
public Boolean getAllowEmptyValue()
Sets the ability to pass empty-valued parameters.
This is valid only for either query
or formData
parameters and allows you to send a
parameter with a name only or an empty value.
public ParameterInfo setAllowEmptyValue(Boolean value)
Sets the ability to pass empty-valued parameters.
This is valid only for either query
or formData
parameters and allows you to send a
parameter with a name only or an empty value.
value
- The new value for this property.
public ParameterInfo allowEmptyValue(Object value)
setAllowEmptyValue(Boolean)
.value
- The new value for this property.
Boolean.valueOf (value.toString())
.
public Items getItems()
Describes the type of items in the array.
public ParameterInfo setItems(Items value)
Describes the type of items in the array.
value
- The new value for this property.
type
is public ParameterInfo items(Object value)
setItems(Items)
.public String getCollectionFormat()
Determines the format of the array if type array is used.
public ParameterInfo setCollectionFormat(String value)
Determines the format of the array if type array is used.
value
- The new value for this property.
foo,bar
.
foo bar
.
foo\tbar
.
foo|bar
.
foo=bar&foo=baz
.
in
public ParameterInfo collectionFormat(Object value)
setCollectionFormat(String)
.value
- The new value for this property.
toString()
.
foo,bar
.
foo bar
.
foo\tbar
.
foo|bar
.
foo=bar&foo=baz
.
in
public Object getDefault()
Declares the value of the parameter that the server will use if none is provided, for example a type
for this parameter.
public ParameterInfo setDefault(Object value)
Declares the value of the parameter that the server will use if none is provided, for example a type
for this parameter.
value
- The new value for this property.public ParameterInfo _default(Object value)
setDefault(Object)
.value
- The new value for this property.public Number getMaximum()
public ParameterInfo setMaximum(Number value)
value
- The new value for this property.public ParameterInfo maximum(Object value)
setMaximum(Number)
.value
- The new value for this property.
toString()
then best number match.
public Boolean getExclusiveMaximum()
public ParameterInfo setExclusiveMaximum(Boolean value)
value
- The new value for this property.public ParameterInfo exclusiveMaximum(Object value)
setExclusiveMaximum(Boolean)
.value
- The new value for this property.
Boolean.valueOf (value.toString())
.
public Number getMinimum()
public ParameterInfo setMinimum(Number value)
value
- The new value for this property.public ParameterInfo minimum(Object value)
setMinimum(Number)
.value
- The new value for this property.
toString()
then best number match.
public Boolean getExclusiveMinimum()
public ParameterInfo setExclusiveMinimum(Boolean value)
value
- The new value for this property.public ParameterInfo exclusiveMinimum(Object value)
setExclusiveMinimum(Boolean)
.value
- The new value for this property.
Boolean.valueOf (value.toString())
.
public Integer getMaxLength()
public ParameterInfo setMaxLength(Integer value)
value
- The new value for this property.public ParameterInfo maxLength(Object value)
setMaxLength(Integer)
.value
- The new value for this property.
Integer.valueOf (value.toString())
.
public Integer getMinLength()
public ParameterInfo setMinLength(Integer value)
value
- The new value for this property.public ParameterInfo minLength(Object value)
setMinLength(Integer)
.value
- The new value for this property.
Integer.valueOf (value.toString())
.
public String getPattern()
public ParameterInfo setPattern(String value)
value
- The new value for this property.public ParameterInfo pattern(Object value)
setPattern(String)
.value
- The new value for this property.
toString()
.
public Integer getMaxItems()
public ParameterInfo setMaxItems(Integer value)
value
- The new value for this property.public ParameterInfo maxItems(Object value)
setMaxItems(Integer)
.value
- The new value for this property.
Integer.valueOf (value.toString())
.
public Integer getMinItems()
public ParameterInfo setMinItems(Integer value)
value
- The new value for this property.public ParameterInfo minItems(Object value)
setMinItems(Integer)
.value
- The new value for this property.
Integer.valueOf (value.toString())
.
public Boolean getUniqueItems()
public ParameterInfo setUniqueItems(Boolean value)
value
- The new value for this property.public ParameterInfo uniqueItems(Object value)
setUniqueItems(Boolean)
.value
- The new value for this property.
Boolean.valueOf (value.toString())
.
public List<Object> getEnum()
public ParameterInfo setEnum(Collection<Object> value)
value
- The new value for this property.
public ParameterInfo addEnum(Collection<Object> value)
value
- The values to add to this property.
public ParameterInfo _enum(Object... values)
values
- The values to add to this property.
Object
Collection<Object>
String
- JSON array representation of Collection<Object>
_enum(
String
- Individual values
_enum(
public Number getMultipleOf()
public ParameterInfo setMultipleOf(Number value)
value
- The new value for this property.
public ParameterInfo multipleOf(Object value)
setMultipleOf(Number)
.value
- The new value for this property.
toString()
then best number match.
public <T> T get(String property, Class<T> type)
SwaggerElement
Can be used to retrieve non-standard Swagger fields such as
get
in class SwaggerElement
property
- The property name to retrieve.type
- The datatype to cast the value to.public ParameterInfo set(String property, Object value)
SwaggerElement
Can be used to set non-standard Swagger fields such as
set
in class SwaggerElement
property
- The property name to set.value
- The new value for the property.Copyright © 2018 Apache. All rights reserved.