# Function: generateSchema()

> **generateSchema**(`obj`): [`Schema`](../../type-aliases/Schema/)

Defined in: [schema.ts:1979](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1979)

Utility that examines a JavaScript value and attempts to infer a schema definition that describes it.

It is vastly preferable to define a schema manually. A clear and accurate schema is one of the fundamentals of a good pack. However, for data that is truly dynamic for which a schema can't be known in advance nor can a function be written to generate a dynamic schema from other inputs, it may be useful to us this helper to sniff the return value and generate a basic inferred schema from it.

This utility does NOT attempt to determine [ObjectSchemaDefinition.idProperty](../../interfaces/ObjectSchemaDefinition/#idproperty) or [ObjectSchemaDefinition.displayProperty](../../interfaces/ObjectSchemaDefinition/#displayproperty) attributes for an object schema, those are left undefined.

## Parameters

| Parameter | Type | | --- | --- | | `obj` | [`InferrableTypes`](../../type-aliases/InferrableTypes/) |

## Returns

[`Schema`](../../type-aliases/Schema/)
