Interface OpenApiOperationBuilder
public interface OpenApiOperationBuilder
Used by routes to configure OpenApi OperationObjects.
-
Method Summary
Modifier and TypeMethodDescriptionSets deprecated=truedescription
(String description) A verbose explanation of the operation behavior.externalDocs
(ExternalDocumentationObject externalDocumentationObject) Additional external documentation for this operation.parameter
(ParameterObject parameter) pathParameter
(String name, String description, boolean required, JsonType type, com.inductiveautomation.ignition.common.gson.JsonElement example) Creates a parameter with the following settings:default OpenApiOperationBuilder
pathParameter
(String name, String description, JsonType type) Creates a parameter with the following settings:default OpenApiOperationBuilder
pathParameter
(String name, String description, JsonType type, com.inductiveautomation.ignition.common.gson.JsonElement example) Creates a parameter with the following settings:queryParameter
(String name, String description, boolean required, JsonType type, com.inductiveautomation.ignition.common.gson.JsonElement example) Creates a parameter with the following settings:refParameter
(String ref) Creates a parameter that uses a reference to a parameter defined in the ComponentsObject.requestBody
(RequestBodyObject requestBody) requestBody
(String description, boolean required, String contentType, com.inductiveautomation.ignition.common.gson.JsonObject schema) For POST and PUT operations, define the shape of the expected request body.requestBody
(String description, boolean required, String contentType, com.inductiveautomation.ignition.common.gson.JsonObject schema, com.inductiveautomation.ignition.common.gson.JsonElement example) response
(int httpStatusCode, ResponseObject response) Adds an arbitrary ResponseObject to the operation.Adds a response with only a description.response
(int httpStatusCode, String description, String contentType, com.inductiveautomation.ignition.common.gson.JsonObject schema) Adds a response with a content type and schema.A short summary of the operation.Adds a tag to the operation.
-
Method Details
-
summary
A short summary of the operation. -
description
A verbose explanation of the operation behavior. CommonMark syntax MAY be used for rich text representation. -
tag
Adds a tag to the operation. Tags can be used for logical grouping of operations by resources or any other qualifier. Null values will be ignored. -
deprecated
OpenApiOperationBuilder deprecated()Sets deprecated=true -
externalDocs
Additional external documentation for this operation. -
pathParameter
Creates a parameter with the following settings:{ name: ${name}, description: ${description}, in: "path", required: true, style: "simple", explode: false, schema: { type: ${type} } }
-
pathParameter
default OpenApiOperationBuilder pathParameter(String name, String description, JsonType type, @Nullable com.inductiveautomation.ignition.common.gson.JsonElement example) Creates a parameter with the following settings:{ name: ${name}, description: ${description}, in: "path", required: true, style: "simple", explode: false, schema: { type: ${type}, example: ${example} } }
-
pathParameter
OpenApiOperationBuilder pathParameter(String name, String description, boolean required, JsonType type, @Nullable com.inductiveautomation.ignition.common.gson.JsonElement example) Creates a parameter with the following settings:{ name: ${name}, description: ${description}, in: "path", required: ${required}, style: "simple", explode: false, schema: { type: ${type}, example: ${example} } }
-
refParameter
Creates a parameter that uses a reference to a parameter defined in the ComponentsObject. -
queryParameter
OpenApiOperationBuilder queryParameter(String name, String description, boolean required, JsonType type, @Nullable com.inductiveautomation.ignition.common.gson.JsonElement example) Creates a parameter with the following settings:{ name: ${name}, description: ${description}, in: "query", required: ${required}, style: "form", explode: true, schema: { type: ${type}, example: ${example} } }
-
requestBody
OpenApiOperationBuilder requestBody(String description, boolean required, String contentType, com.inductiveautomation.ignition.common.gson.JsonObject schema) For POST and PUT operations, define the shape of the expected request body.- Parameters:
description
- A brief description of the request body.required
- Whether the request body is required.contentType
- The content type of the request body.schema
- The schema of the request body.
-
requestBody
OpenApiOperationBuilder requestBody(String description, boolean required, String contentType, com.inductiveautomation.ignition.common.gson.JsonObject schema, @Nullable com.inductiveautomation.ignition.common.gson.JsonElement example) -
requestBody
-
parameter
-
response
Adds a response with only a description. For example:builder.response(404, "Item not found");
-
response
OpenApiOperationBuilder response(int httpStatusCode, String description, String contentType, com.inductiveautomation.ignition.common.gson.JsonObject schema) Adds a response with a content type and schema. For example:builder.response(200, "Success. Returns an object with 'itemId' and 'description'.", "application/json", JsonParser.parseString( """ { type: "object", properties: { itemId: { type: "string", example: "ABC-123" }, description: { type: "string", example: "lorem ipsum..." } } } """) );
-
response
Adds an arbitrary ResponseObject to the operation. Use a negative number for the httpStatusCode to store the response as the default response.
-