Package-level declarations

Types

Link copied to clipboard
abstract class BodyBuilder(context: OpenApiDslContext) : BodyDsl

A default builder for anything that needs to implement BodyDsl.

Link copied to clipboard

DSL for body-like objects, i.e. objects that contain a "content" property.

Link copied to clipboard
fun interface Builder<out T>

Interface for anything that "builds" into T.

Link copied to clipboard
data class ContentType(val contentType: String)

A content type.

Link copied to clipboard
class InfoBuilder : Builder<Info> , InfoDsl

Builder object for the info object.

Link copied to clipboard
interface InfoDsl

DSL for the info object.

Link copied to clipboard

A builder for MediaTypeDsl.

Link copied to clipboard
interface MediaTypeDsl

DSL for media type objects(https://spec.openapis.org/oas/v3.1.0#media-type-object

Link copied to clipboard
data class MultiContentType(val types: List<ContentType>)

Represents multiple content types. This is useful for functions that can be applied to multiple content types at a time (mostly for the sake of concision).

Link copied to clipboard

This interface is passed to most of the builder classes and provides utilities that need to be present through the "DSL tree".

Link copied to clipboard

A version of the OpenAPI standard. This only includes the x.y part of the x.y.z version scheme.

Link copied to clipboard

Builder for OperationDsl

Link copied to clipboard
interface OperationDsl

DSL for the operation object.

Link copied to clipboard
class ParameterBuilder(context: OpenApiDslContext, name: String, kind: ParameterKind) : Builder<Parameter> , ParameterDsl

Builder for ParameterDsl

Link copied to clipboard

DSL for https://spec.openapis.org/oas/v3.1.0#parameter-object

Link copied to clipboard

The kind of parameter (i.e. its location).

Link copied to clipboard
class PathBuilder(context: OpenApiDslContext) : PathDsl, Builder<PathItem>

Builder for PathDsl

Link copied to clipboard
interface PathDsl

DSL for the path item object.

Link copied to clipboard
class PathsBuilder(context: OpenApiDslContext) : PathsDsl, Builder<Paths>

Builder for PathsDsl.

Link copied to clipboard
interface PathsDsl

DSL for the paths object.

Link copied to clipboard

Interface that contains standard content types.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Builder for Response objects, implementing the ResponseDsl.

Link copied to clipboard
interface ResponseDsl : BodyDsl

DSL for https://spec.openapis.org/oas/v3.1.0#response-object.

Link copied to clipboard
class RootBuilder(context: OpenApiDslContext, infoBuilder: InfoBuilder = InfoBuilder(), paths: PathsBuilder = PathsBuilder(context), securitySchemes: MutableMap<String, SecuritySchemeBuilder> = mutableMapOf()) : RootDsl, InfoDsl, PathsDsl, Builder<OpenAPI>

Builder for the RootDsl.

Link copied to clipboard

This is the root DSL object for the Tegral OpenAPI DSL.

Link copied to clipboard

Builder for the security scheme DSL.

Link copied to clipboard
Link copied to clipboard
class ServerBuilder(url: String) : ServerDsl, Builder<Server>

Builder for ServerDsl.

Link copied to clipboard
interface ServerDsl

DSL for the server object.

Link copied to clipboard

An implementation of OpenApiDslContext that keeps context information for Swagger Core.

Link copied to clipboard
class TagBuilder(name: String) : TagDsl, Builder<Tag>

Actual builder for TagDsl.

Link copied to clipboard
interface TagDsl

DSL for the tag object.

Link copied to clipboard
interface TagsDsl

DSL for the objects that can contain tags listed by name.

Functions

Link copied to clipboard
fun openApi(builder: RootDsl.() -> Unit): OpenAPI

Entrypoint for the Tegral OpenAPI DSL.

Link copied to clipboard
inline fun <T> MediaTypeDsl.schema()

Set the schema to be of type T.

inline fun <T> MediaTypeDsl.schema(example: T)

Set the schema to be of type T, with the given object set as the example.

fun <T> MediaTypeDsl.schema(ktype: KType, example: T)

Set the schema to be of type ktype, with the given object set as the example.

Link copied to clipboard
fun OpenAPI.toJson(version: OpenApiVersion = OpenApiVersion.V3_0): String

Dumps this OpenAPI object to a JSON string.

Link copied to clipboard
fun OpenAPI.toOpenApi31(): OpenAPI

Converts this OpenAPI object to a version 3.1 OpenAPI object.

Link copied to clipboard
fun OpenAPI.toYaml(version: OpenApiVersion = OpenApiVersion.V3_0): String

Dumps this OpenAPI object to a prettified YAML string.

Properties

Link copied to clipboard

Sets the type of this security scheme to API key.

Link copied to clipboard

Sets the type of this security scheme to HTTP.

Link copied to clipboard

Sets the location of this security scheme to be in a cookie.

Link copied to clipboard

Sets the location of this security scheme to be in a header.

Link copied to clipboard

Sets the location of this security scheme to be in a query parameter.

Link copied to clipboard

Sets the type of this security scheme to Mutual TLS.

Link copied to clipboard

Sets the type of this security scheme to OAuth 2.

Link copied to clipboard

Sets the type of this security scheme to OpenID Connect.