OpenAPI document
CLASS
@skmtc/core 0.63.4OasExample
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 OasExampleConstructor
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(): booleanAlways false: readOnly is a schema keyword.
isWriteOnly
isWriteOnly(): booleanAlways false: writeOnly is a schema keyword.
resolve
resolve(): OasExampleReturns itself
resolveOnce
resolveOnce(): OasExampletoJsonSchema
toJsonSchema(
_options: ToJsonSchemaOptions
): OpenAPIV3.ExampleObject & { dataValue?: unknown; serializedValue?: string }