# Interface: JsonSharedConstraints

> Defined in: [packages/fast-check/src/arbitrary/\_internals/helpers/JsonConstraintsBuilder.ts:17](https://github.com/dubzzz/fast-check/blob/4663db899d411b24434189b8e560b5ecefc93f23/packages/fast-check/src/arbitrary/_internals/helpers/JsonConstraintsBuilder.ts#L17)

# Interface: JsonSharedConstraints

Defined in: [packages/fast-check/src/arbitrary/\_internals/helpers/JsonConstraintsBuilder.ts:17](https://github.com/dubzzz/fast-check/blob/4663db899d411b24434189b8e560b5ecefc93f23/packages/fast-check/src/arbitrary/_internals/helpers/JsonConstraintsBuilder.ts#L17)

Shared constraints for:
- [json](../functions/json.md),
- [jsonValue](../functions/jsonValue.md),

## Remarks

Since 2.5.0

## Properties

### depthSize? {#depthsize}

> `optional` **depthSize?**: [`DepthSize`](../type-aliases/DepthSize.md)

Defined in: [packages/fast-check/src/arbitrary/\_internals/helpers/JsonConstraintsBuilder.ts:24](https://github.com/dubzzz/fast-check/blob/4663db899d411b24434189b8e560b5ecefc93f23/packages/fast-check/src/arbitrary/_internals/helpers/JsonConstraintsBuilder.ts#L24)

Limit the depth of the object by increasing the probability to generate simple values (defined via values)
as we go deeper in the object.

#### Remarks

Since 2.20.0

***

### maxDepth? {#maxdepth}

> `optional` **maxDepth?**: `number`

Defined in: [packages/fast-check/src/arbitrary/\_internals/helpers/JsonConstraintsBuilder.ts:30](https://github.com/dubzzz/fast-check/blob/4663db899d411b24434189b8e560b5ecefc93f23/packages/fast-check/src/arbitrary/_internals/helpers/JsonConstraintsBuilder.ts#L30)

Maximal depth allowed

#### Default Value

Number.POSITIVE_INFINITY — _defaulting seen as "max non specified" when `defaultSizeToMaxWhenMaxSpecified=true`_

#### Remarks

Since 2.5.0

***

### ~~noUnicodeString?~~ {#nounicodestring}

> `optional` **noUnicodeString?**: `boolean`

Defined in: [packages/fast-check/src/arbitrary/\_internals/helpers/JsonConstraintsBuilder.ts:37](https://github.com/dubzzz/fast-check/blob/4663db899d411b24434189b8e560b5ecefc93f23/packages/fast-check/src/arbitrary/_internals/helpers/JsonConstraintsBuilder.ts#L37)

Only generate instances having keys and values made of ascii strings (when true)

#### Deprecated

Prefer using `stringUnit` to customize the kind of strings that will be generated by default.

#### Default Value

```ts
true
```

#### Remarks

Since 3.19.0

***

### stringUnit? {#stringunit}

> `optional` **stringUnit?**: `"grapheme"` \| `"grapheme-composite"` \| `"grapheme-ascii"` \| `"binary"` \| `"binary-ascii"` \| [`Arbitrary`](../classes/Arbitrary.md)\<`string`\>

Defined in: [packages/fast-check/src/arbitrary/\_internals/helpers/JsonConstraintsBuilder.ts:43](https://github.com/dubzzz/fast-check/blob/4663db899d411b24434189b8e560b5ecefc93f23/packages/fast-check/src/arbitrary/_internals/helpers/JsonConstraintsBuilder.ts#L43)

Replace the default unit for strings.

#### Default Value

```ts
undefined
```

#### Remarks

Since 3.23.0
