mappedTo

infix fun String.mappedTo(ref: String)(source)

Maps a discriminator value to a schema reference, automatically adding the reference to the parent oneOf options and the explicit mapping.

This eliminates duplication - you don't need to specify the reference twice.

Receiver

The discriminator value (e.g., "dog", "cat")

Parameters

ref

The schema reference (e.g., "#/definitions/Dog")


Maps a discriminator value to an inline object schema, automatically adding it to the parent oneOf options.

This is a concise form for defining inline objects without the obj keyword.

Receiver

The discriminator value (e.g., "credit_card", "paypal")

Parameters

block

Builder block for defining object properties