Class OpenApiSourceBase
java.lang.Object
io.helidon.openapi.OpenApiSourceBase
- All Implemented Interfaces:
OpenApiDocumentSource
Base class for generated OpenAPI document sources.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static JsonObjectarraySchema(JsonObject items) Create an array schema object.protected static voidcomponentSchema(OpenApiDocument.Builder document, JsonSchemaProvider provider, String name) Add a component schema from a JSON schema provider to the OpenAPI document.protected static JsonValueexampleValue(String value) Create an OpenAPI example value from annotation text.protected static JsonValueextensionValue(String name, String value, boolean parseValue) Create an OpenAPI extension value from resolved annotation text.protected static JsonObjectCreate a simple schema object for a JSON type.protected static JsonObjectCreate a schema reference object.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface OpenApiDocumentSource
describe, supportsModifier and TypeMethodDescriptionvoiddescribe(OpenApiDocumentContext context, OpenApiDocument.Builder document) Describe this source as OpenAPI document metadata.default booleansupports(OpenApiDocumentContext context) Whether this source contributes to the provided document context.
-
Constructor Details
-
OpenApiSourceBase
protected OpenApiSourceBase()Constructor with no side effects.
-
-
Method Details
-
schemaRef
Create a schema reference object.- Parameters:
name- schema name- Returns:
- schema reference JSON object
-
schema
Create a simple schema object for a JSON type.- Parameters:
type- JSON schema type- Returns:
- schema JSON object
-
arraySchema
Create an array schema object.- Parameters:
items- array item schema- Returns:
- array schema JSON object
-
exampleValue
-
extensionValue
Create an OpenAPI extension value from resolved annotation text.- Parameters:
name- extension namevalue- resolved annotation valueparseValue- whether to parse the value as JSON- Returns:
- extension JSON value
- Throws:
IllegalArgumentException- if parsing is enabled and the value is not exactly one valid JSON value
-
componentSchema
protected static void componentSchema(OpenApiDocument.Builder document, JsonSchemaProvider provider, String name) Add a component schema from a JSON schema provider to the OpenAPI document.- Parameters:
document- OpenAPI document builderprovider- JSON schema providername- schema name
-