Docs@skmtc/core

OpenAPI document

CLASS

OasExample

@skmtc/core 0.63.4

An example of a parameter, a header or a media type. The example of a schema is a plain value, not an OasExample.

The example is in value, or externalValue has its URL, which core does not read. In OpenAPI 3.2, it can also be in dataValue, or in its serialized form in serializedValue.

Signature

import { OasExample } from '@skmtc/core'

class OasExample

Constructor

constructor

constructor(fields: ExampleFields)

Properties

oasType, 'example'

Static identifier property for OasExample

description, string | undefined
value, unknown
dataValue, unknown
serializedValue, string | undefined
externalValue, string | undefined
extensionFields, Record<string, unknown> | undefined

Methods

isRef

isRef(): this is OasRef<'example'>

Returns true if object is a reference

isReadOnly

isReadOnly(): boolean

Always false: readOnly is a schema keyword.

isWriteOnly

isWriteOnly(): boolean

Always false: writeOnly is a schema keyword.

resolve

resolve(): OasExample

Returns itself

resolveOnce

resolveOnce(): OasExample

toJsonSchema

toJsonSchema(
  _options: ToJsonSchemaOptions
): OpenAPIV3.ExampleObject & { dataValue?: unknown; serializedValue?: string }