mergeWithSubSchemas

fun mergeWithSubSchemas(input: Schema<*>, openAPI: OpenAPI): Schema<*>

Merges a schema with its allOf/anyOf/oneOf subschemas into a single flat schema, resolving $ref schemas against the components of openAPI.

Convenience overload of mergeWithSubSchemas that installs the standard #/components/schemas/ resolver (SchemaTypeHelpers.tryGetSchemaFromRef) and starts with a fresh traversal state.

Return

merged schema with all subschema constraints applied

Parameters

input

the source schema containing composed subschemas

openAPI

OpenAPI document providing component definitions for $ref resolution


fun mergeWithSubSchemas(input: Schema<*>, depth: Int, visitedRefs: MutableSet<String>, resolve: (Schema<*>) -> Schema<*> = { it }): Schema<*>

Merges a schema with its allOf/anyOf/oneOf subschemas into a single flat schema.

Return

merged schema with all subschema constraints applied

Parameters

input

the source schema containing composed subschemas

depth

current recursion depth for cycle protection

visitedRefs

mutable set tracking visited $ref pointers to prevent infinite loops

resolve

function to dereference $ref schemas