> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# Function: createParser()

> **createParser**(`schema`: [`LibraryJSONSchema`](/next/api/genui/openui/core/interfaces/LibraryJSONSchema.md), `rootName?`: `string`): `Parser`

Create a parser from a library JSON Schema document.
Pass `library.toJSONSchema()` to get the schema.

## Parameters

| Parameter   | Type                                                                               |
| ----------- | ---------------------------------------------------------------------------------- |
| `schema`    | [`LibraryJSONSchema`](/next/api/genui/openui/core/interfaces/LibraryJSONSchema.md) |
| `rootName?` | `string`                                                                           |

## Returns

`Parser`

## Example

```ts
const parser = createParser(library.toJSONSchema());
const result = parser.parse(openuiLangString);
```
