Example

zio.blocks.openapi.Example
See theExample companion object
final case class Example(summary: Option[Doc] = ..., description: Option[Doc] = ..., value: Option[Json] = ..., externalValue: Option[String] = ..., extensions: ChunkMap[String, Json] = ...)

An object representing an example.

In all cases, the example value is expected to be compatible with the type schema of its associated value. Tooling implementations MAY choose to validate compatibility automatically, and reject the example value if incompatible.

Value parameters

description

Long description for the example. CommonMark syntax MAY be used for rich text representation.

extensions

Specification extensions (x-* fields). These allow adding additional properties beyond the standard OpenAPI fields.

externalValue

A URI that identifies the location of the example value. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The value field and externalValue field are mutually exclusive. See the rules for resolving Relative References.

summary

Short description for the example.

value

Embedded literal example. The value field and externalValue field are mutually exclusive. To represent examples of media types that cannot be represented in JSON or YAML naturally, use a string value to contain the example, escaping where necessary.

Attributes

Companion
object
Source
OpenAPI.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala