Class OpenApiDocument.Builder
java.lang.Object
io.helidon.openapi.OpenApiDocument.Builder
- All Implemented Interfaces:
Builder<OpenApiDocument.Builder, OpenApiDocument>, Supplier<OpenApiDocument>
- Enclosing class:
OpenApiDocument
public static final class OpenApiDocument.Builder
extends Object
implements Builder<OpenApiDocument.Builder, OpenApiDocument>
OpenAPI document builder.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the instance from this builder.components(OpenApiDocument.Components components) Add or merge components.components(Consumer<OpenApiDocument.ComponentsBuilder> components) Add or merge components.Add an extension.externalDocs(OpenApiDocument.ExternalDocs externalDocs) Set external documentation.externalDocs(Consumer<OpenApiDocument.ExternalDocsBuilder> externalDocs) Set external documentation.info(OpenApiDocument.Info info) Set the Info object.Set the required Info object values.Set the Info object.jsonSchemaDialect(String jsonSchemaDialect) Set the JSON Schema dialect URI.merge(OpenApiDocument document) Merge another OpenAPI document into this builder.Set the OpenAPI version string.path(String path, OpenApiDocument.PathItem pathItem) Add or merge a path item.path(String path, Consumer<OpenApiDocument.PathItemBuilder> pathItem) Add or merge a path item.pathExtension(String name, JsonValue value) Add an extension to the paths object.paths(Map<String, OpenApiDocument.PathItem> paths) Add or merge path items.securityRequirement(OpenApiDocument.SecurityRequirement requirement) Add a security requirement.securityRequirement(String name, List<String> scopes) Add a security requirement.Add a security requirement.Set the OpenAPI 3.2 document identity URI.server(OpenApiDocument.Server server) Add a server.server(Consumer<OpenApiDocument.ServerBuilder> server) Add a server.tag(OpenApiDocument.Tag tag) Add a document tag.Add a document tag.Add a document tag.webhook(String name, OpenApiDocument.PathItem pathItem) Add or merge a webhook path item.webhook(String name, Consumer<OpenApiDocument.PathItemBuilder> pathItem) Add or merge a webhook path item.webhooks(Map<String, OpenApiDocument.PathItem> webhooks) Add or merge webhook path items.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Builder
get, identity, updateModifier and TypeMethodDescriptiondefault OpenApiDocumentget()default OpenApiDocument.Builderidentity()Instance of this builder as the correct type.default OpenApiDocument.Builderupdate(Consumer<OpenApiDocument.Builder> consumer) Update the builder in a fluent API way.
-
Method Details
-
openapi
Set the OpenAPI version string.- Parameters:
openapi- OpenAPI version- Returns:
- updated builder
-
self
Set the OpenAPI 3.2 document identity URI.A relative identity is resolved against the configured OpenAPI web context. When the identity is relative, Helidon cannot determine whether an absolute reference identifies this document because composition does not have the request scheme or authority. That combination is not supported; use an absolute document identity or relative references instead.
- Parameters:
self- document identity URI- Returns:
- updated builder
-
jsonSchemaDialect
Set the JSON Schema dialect URI.- Parameters:
jsonSchemaDialect- JSON Schema dialect URI- Returns:
- updated builder
-
info
Set the required Info object values.- Parameters:
title- API titleversion- API version- Returns:
- updated builder
-
info
Set the Info object.- Parameters:
info- info- Returns:
- updated builder
-
info
Set the Info object.- Parameters:
info- consumer to update info builder- Returns:
- updated builder
-
server
Add a server.- Parameters:
server- server model- Returns:
- updated builder
-
server
Add a server.- Parameters:
server- consumer to update server builder- Returns:
- updated builder
-
paths
Add or merge path items.An empty map adds an empty Paths Object.
- Parameters:
paths- path items keyed by OpenAPI path- Returns:
- updated builder
-
path
Add or merge a path item.- Parameters:
path- OpenAPI pathpathItem- path item- Returns:
- updated builder
-
path
public OpenApiDocument.Builder path(String path, Consumer<OpenApiDocument.PathItemBuilder> pathItem) Add or merge a path item.- Parameters:
path- OpenAPI pathpathItem- consumer to update path item builder- Returns:
- updated builder
-
pathExtension
Add an extension to the paths object.Extension names must start with
x-.- Parameters:
name- extension namevalue- extension value- Returns:
- updated builder
-
webhooks
Add or merge webhook path items.An empty map adds an empty Webhooks Object.
- Parameters:
webhooks- webhook path items keyed by name- Returns:
- updated builder
-
webhook
Add or merge a webhook path item.- Parameters:
name- webhook namepathItem- path item- Returns:
- updated builder
-
webhook
public OpenApiDocument.Builder webhook(String name, Consumer<OpenApiDocument.PathItemBuilder> pathItem) Add or merge a webhook path item.- Parameters:
name- webhook namepathItem- consumer to update path item builder- Returns:
- updated builder
-
components
Add or merge components.- Parameters:
components- components- Returns:
- updated builder
-
components
Add or merge components.- Parameters:
components- consumer to update components builder- Returns:
- updated builder
-
securityRequirement
Add a security requirement.- Parameters:
name- security scheme namescopes- security scopes- Returns:
- updated builder
-
securityRequirement
Add a security requirement.- Parameters:
requirement- security requirement- Returns:
- updated builder
-
securityRequirement
public OpenApiDocument.Builder securityRequirement(Consumer<OpenApiDocument.SecurityRequirementBuilder> requirement) Add a security requirement.- Parameters:
requirement- consumer to update security requirement builder- Returns:
- updated builder
-
tag
Add a document tag.- Parameters:
name- tag namedescription- tag description- Returns:
- updated builder
-
tag
Add a document tag.- Parameters:
tag- tag model- Returns:
- updated builder
-
tag
Add a document tag.- Parameters:
tag- consumer to update tag builder- Returns:
- updated builder
-
externalDocs
Set external documentation.- Parameters:
externalDocs- external documentation- Returns:
- updated builder
-
externalDocs
public OpenApiDocument.Builder externalDocs(Consumer<OpenApiDocument.ExternalDocsBuilder> externalDocs) Set external documentation.- Parameters:
externalDocs- consumer to update external documentation builder- Returns:
- updated builder
-
extension
Add an extension.Extension names must start with
x-.- Parameters:
name- extension namevalue- extension value- Returns:
- updated builder
-
merge
Merge another OpenAPI document into this builder.- Parameters:
document- document to merge- Returns:
- updated builder
- Throws:
IllegalStateException- if both documents define conflicting values or the same path operation
-
build
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<OpenApiDocument.Builder, OpenApiDocument>- Returns:
- instance of the built type
-