# OasExample

CLASS in `@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

```ts
import { OasExample } from '@skmtc/core'

class OasExample
```

## Constructor

### constructor

```ts
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

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

Returns true if object is a reference

### isReadOnly

```ts
isReadOnly(): boolean
```

Always `false`: `readOnly` is a schema keyword.

### isWriteOnly

```ts
isWriteOnly(): boolean
```

Always `false`: `writeOnly` is a schema keyword.

### resolve

```ts
resolve(): OasExample
```

Returns itself

### resolveOnce

```ts
resolveOnce(): OasExample
```

### toJsonSchema

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