Package springfox.documentation.builders
Class OperationBuilder
- java.lang.Object
-
- springfox.documentation.builders.OperationBuilder
-
public class OperationBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description OperationBuilder(OperationNameGenerator nameGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description OperationBuilderauthorizations(java.util.Collection<SecurityReference> securityReferences)Updates the security checks that apply to this operationOperationbuild()OperationBuildercodegenMethodNameStem(java.lang.String codeGenMethodNameStem)This is an optional override that provides a custom method name stem, such that the method name that is generated for the purposes of code-gen can be customized.OperationBuilderconsumes(java.util.Set<java.lang.String> mediaTypes)Updates the existing media types with new entries that this documentation consumesOperationBuilderdeprecated(java.lang.String deprecated)Marks the listing as deprecatedOperationBuilderextensions(java.util.List<VendorExtension> extensions)Updates the operation extensionsOperationBuilderexternalDocumentation(ExternalDocumentation externalDocumentation)OperationBuilderhidden(boolean isHidden)Marks the operation as hiddenOperationBuildermethod(org.springframework.http.HttpMethod method)Updates the http methodOperationBuildernotes(java.lang.String notes)Updates the operation notesOperationBuilderparameters(java.util.List<Parameter> parameters)Deprecated.OperationBuilderposition(int position)Updates the index of the operationOperationBuilderproduces(java.util.Set<java.lang.String> mediaTypes)Updates the existing media types with new entries that this documentation producesOperationBuilderprotocols(java.util.Set<java.lang.String> protocols)Update the protocols this operation supportsOperationBuilderrequestBody(RequestBody requestBody)Updates the operation request body.OperationBuilderrequestParameters(java.util.Collection<RequestParameter> parameters)Updates the operation response bodyOperationBuilderresponseMessages(java.util.Set<ResponseMessage> responseMessages)Deprecated.OperationBuilderresponseModel(ModelReference responseType)Deprecated.OperationBuilderresponses(java.util.Collection<Response> responses)Updates the response messagesOperationBuildersummary(java.lang.String summary)Updates the operation summaryOperationBuildertags(java.util.Set<java.lang.String> tags)Updates the tags that identify this operationOperationBuilderuniqueId(java.lang.String uniqueId)Updates the uniqueId for the operation.
-
-
-
Constructor Detail
-
OperationBuilder
public OperationBuilder(OperationNameGenerator nameGenerator)
-
-
Method Detail
-
method
public OperationBuilder method(org.springframework.http.HttpMethod method)
Updates the http method- Parameters:
method- - http method, one of GET, POST, PUT etc.- Returns:
- this
-
summary
public OperationBuilder summary(java.lang.String summary)
Updates the operation summary- Parameters:
summary- - operation summary- Returns:
- this
-
notes
public OperationBuilder notes(java.lang.String notes)
Updates the operation notes- Parameters:
notes- - notes to describe the operation- Returns:
- this
-
uniqueId
public OperationBuilder uniqueId(java.lang.String uniqueId)
Updates the uniqueId for the operation. This will be used to seed the unique id- Parameters:
uniqueId- - uniqueId for the operation- Returns:
- this
-
codegenMethodNameStem
public OperationBuilder codegenMethodNameStem(java.lang.String codeGenMethodNameStem)
This is an optional override that provides a custom method name stem, such that the method name that is generated for the purposes of code-gen can be customized. However it must be kept in mind that in-order the guarantee uniqueness of the name for code-gen the algorithm will still try to append and indexer at the end of it e.g. someMethod_1, someMethod_2 etc. to preserve uniqueness in the case there are duplicate names.- Parameters:
codeGenMethodNameStem- - provides a stem for the operation name as it will be used for code generation- Returns:
- this
-
position
public OperationBuilder position(int position)
Updates the index of the operation- Parameters:
position- - position is used to sort the operation in a particular order- Returns:
- this
-
produces
public OperationBuilder produces(java.util.Set<java.lang.String> mediaTypes)
Updates the existing media types with new entries that this documentation produces- Parameters:
mediaTypes- - new media types- Returns:
- this
-
consumes
public OperationBuilder consumes(java.util.Set<java.lang.String> mediaTypes)
Updates the existing media types with new entries that this documentation consumes- Parameters:
mediaTypes- - new media types- Returns:
- this
-
protocols
public OperationBuilder protocols(java.util.Set<java.lang.String> protocols)
Update the protocols this operation supports- Parameters:
protocols- - protocols- Returns:
- this
-
authorizations
public OperationBuilder authorizations(java.util.Collection<SecurityReference> securityReferences)
Updates the security checks that apply to this operation- Parameters:
securityReferences- - authorization that reference security definitions- Returns:
- this
-
parameters
@Deprecated public OperationBuilder parameters(java.util.List<Parameter> parameters)
Deprecated.Updates the input parameters this operation needs- Parameters:
parameters- - input parameter definitions- Returns:
- this
- Since:
- 3.0.0
Use @see
requestParameters(Collection)
-
responseMessages
@Deprecated public OperationBuilder responseMessages(java.util.Set<ResponseMessage> responseMessages)
Deprecated.- Parameters:
responseMessages- - new response messages to be merged with existing response messages- Returns:
- this
- Since:
- 3.0.0
Updates the response messages
Use @see
responses(Collection)
-
responses
public OperationBuilder responses(java.util.Collection<Response> responses)
Updates the response messages- Parameters:
responses- - new response messages to be merged with existing response messages- Returns:
- this
- Since:
- 3.0.0
-
deprecated
public OperationBuilder deprecated(java.lang.String deprecated)
Marks the listing as deprecated- Parameters:
deprecated- - surely this had to be a boolean!! TODO!!- Returns:
- this
-
hidden
public OperationBuilder hidden(boolean isHidden)
Marks the operation as hidden- Parameters:
isHidden- - boolean flag to indicate that the operation is hidden- Returns:
- this
-
externalDocumentation
public OperationBuilder externalDocumentation(ExternalDocumentation externalDocumentation)
-
responseModel
@Deprecated public OperationBuilder responseModel(ModelReference responseType)
Deprecated.- Parameters:
responseType- = response type model reference- Returns:
- this
- Since:
- 3.0.0
Updates the reference to the response model
Use @see
responses(Collection)
-
tags
public OperationBuilder tags(java.util.Set<java.lang.String> tags)
Updates the tags that identify this operation- Parameters:
tags- - new set of tags- Returns:
- this
-
extensions
public OperationBuilder extensions(java.util.List<VendorExtension> extensions)
Updates the operation extensions- Parameters:
extensions- - operation extensions- Returns:
- this
-
requestBody
public OperationBuilder requestBody(RequestBody requestBody)
Updates the operation request body. This overrides the one determined by the plugins- Parameters:
requestBody- - operation extensions- Returns:
- this
- Since:
- 3.0.0
-
requestParameters
public OperationBuilder requestParameters(java.util.Collection<RequestParameter> parameters)
Updates the operation response body- Parameters:
parameters- - operation extensions- Returns:
- this
- Since:
- 3.0.0
-
build
public Operation build()
-
-