> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class: VSemantic<Type, IsOptional, FieldPaths>

> A domain contract uses the ordinary value representation on the wire.

[values](/api/modules/values).VSemantic

A domain contract uses the ordinary value representation on the wire.

## Type parameters

| Name | Type |
| :- | :- |
| `Type` | `Type` |
| `IsOptional` | extends [`OptionalProperty`](/api/modules/values#optionalproperty) = `"required"` |
| `FieldPaths` | extends `string` = `never` |

## Hierarchy

* `BaseValidator`\<`Type`, `IsOptional`, `FieldPaths`>

  ↳ **`VSemantic`**

## Constructors

### constructor

• **new VSemantic**\<`Type`, `IsOptional`, `FieldPaths`>(`definition`, `isOptional`, `baseValidator?`)

#### Type parameters

| Name | Type |
| :- | :- |
| `Type` | `Type` |
| `IsOptional` | extends [`OptionalProperty`](/api/modules/values#optionalproperty) = `"required"` |
| `FieldPaths` | extends `string` = `never` |

#### Parameters

| Name | Type |
| :- | :- |
| `definition` | [`SemanticDefinition`](/api/modules/values#semanticdefinition) |
| `isOptional` | `IsOptional` |
| `baseValidator?` | [`Validator`](/api/modules/values#validator)\<`any`, `"required"`, `any`> |

#### Overrides

BaseValidator\&lt;Type, IsOptional, FieldPaths\&gt;.constructor

## Properties

### type

• `Readonly` **type**: `Type`

Only for TypeScript, the TS type of the JS values validated
by this validator.

#### Inherited from

BaseValidator.type

***

### fieldPaths

• `Readonly` **fieldPaths**: `FieldPaths`

Only for TypeScript, if this an Object validator, then
this is the TS type of its property names.

#### Inherited from

BaseValidator.fieldPaths

***

### isOptional

• `Readonly` **isOptional**: `IsOptional`

Whether this is an optional Object property value validator.

#### Inherited from

BaseValidator.isOptional

***

### isConvexValidator

• `Readonly` **isConvexValidator**: `true`

Always `"true"`.

#### Inherited from

BaseValidator.isConvexValidator

***

### kind

• `Readonly` **kind**: `"semantic"`

***

### baseValidator

• `Optional` `Readonly` **baseValidator**: [`Validator`](/api/modules/values#validator)\<`any`, `"required"`, `any`>

## Accessors

### json

• `get` **json**(): [`ValidatorJSON`](/api/modules/values#validatorjson)

#### Returns

[`ValidatorJSON`](/api/modules/values#validatorjson)

#### Overrides

BaseValidator.json

## Methods

### parse

▸ **parse**(`value`): `Type`

#### Parameters

| Name | Type |
| :- | :- |
| `value` | `unknown` |

#### Returns

`Type`

***

### safeParse

▸ **safeParse**(`value`): \{ `success`: `true` ; `data`: `Type`  } | \{ `success`: `false` ; `error`: [`SemanticValueError`](/api/classes/values.SemanticValueError)  }

#### Parameters

| Name | Type |
| :- | :- |
| `value` | `unknown` |

#### Returns

\{ `success`: `true` ; `data`: `Type`  } | \{ `success`: `false` ; `error`: [`SemanticValueError`](/api/classes/values.SemanticValueError)  }

***

### optional

▸ **optional**(): [`VSemantic`](/api/classes/values.VSemantic)\<`Type` | `undefined`, `"optional"`, `FieldPaths`>

#### Returns

[`VSemantic`](/api/classes/values.VSemantic)\<`Type` | `undefined`, `"optional"`, `FieldPaths`>

#### Overrides

BaseValidator.optional

***

### asOptional

▸ **asOptional**(): [`VSemantic`](/api/classes/values.VSemantic)\<`undefined` | `Type`, `"optional"`, `FieldPaths`>

#### Returns

[`VSemantic`](/api/classes/values.VSemantic)\<`undefined` | `Type`, `"optional"`, `FieldPaths`>

#### Overrides

BaseValidator.asOptional

***

### required

▸ **required**(): [`VSemantic`](/api/classes/values.VSemantic)\<`Exclude`\<`Type`, `undefined`>, `"required"`, `FieldPaths`>

Retain the domain contract and native file metadata when requiring a value.

#### Returns

[`VSemantic`](/api/classes/values.VSemantic)\<`Exclude`\<`Type`, `undefined`>, `"required"`, `FieldPaths`>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.