# @apimatic/schema

> This package provides utilities for creating schema for different types, along with serialization information.

Latest version **0.7.21** (published 2025-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @apimatic/schema
pnpm add @apimatic/schema
yarn add @apimatic/schema
bun add @apimatic/schema
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.7.21 |
| Published | 2025-09-30 |
| First published | 2020-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.15.0 \|\| >=16.0.0 |
| Dependencies | 1 |
| Unpacked size | 287.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | APIMatic Ltd. |
| Maintainers | apimaticdev, mehdi991, maryamadnan3, hamzamahmood, aliasghar1070, talhafaheem |

## Links

- npm: https://www.npmjs.com/package/@apimatic/schema
- Repository: https://github.com/apimatic/apimatic-js-runtime
- Homepage: https://github.com/apimatic/apimatic-js-runtime#readme
- Issues: https://github.com/apimatic/apimatic-js-runtime/issues
- npm.io page: https://npm.io/package/@apimatic/schema

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.8.1

## Recent versions

- 0.7.21 (latest) — 2025-09-30
- 0.7.21-alpha.2 — 2025-09-29
- 0.7.21-alpha.1 — 2025-09-29
- 0.7.21-alpha.0 — 2025-09-04
- 0.7.20 — 2025-09-04
- 0.7.19 — 2025-09-02
- 0.7.18 — 2025-08-13
- 0.7.17 — 2025-07-11
- 0.7.16 — 2025-05-15
- 0.7.15 — 2024-12-12
- 0.7.14 — 2024-11-28
- 0.7.13 — 2024-09-27
- 0.7.12 — 2024-07-22
- 0.7.11 — 2024-06-27
- 0.7.10 — 2024-06-27
- … 16 more at https://npm.io/package/@apimatic/schema/versions

## README

# APIMatic Schema Library for JavaScript SDKs

This package provides utilities for creating schema for different types, along with serialization information.

The exported functionality includes:

* **Bidirectional Data Transformation & Validation**: Transforms data between external API formats (JSON/XML) and internal TypeScript types, validates before mapping or unmapping, and reports errors with detailed path information.
* **Object Schema Variants**: Offers strict, flexible, and expandable object parsing options, including support for typing additional properties.
* **Schema Modifiers & Utilities**: Supports optional and nullable values, array and dictionary validation, default values, and constant value schemas.
* **Union Type Handling**: Enables exclusive (oneOf) and inclusive (anyOf) unions, along with discriminated unions for efficient schema selection.
* **XML Processing**: Maps XML attributes and elements, supports custom naming, and provides specialized XML validation and transformation methods.
* **Core Validation Functions**: Validates and maps/unmaps JSON and XML for serialization and deserialization.

This library is used by JavaScript SDKs generated by the [APIMatic Code Generator](http://www.apimatic.io). For details on supported platforms and build artifacts, see the [Build and Usage Section](https://github.com/apimatic/apimatic-js-runtime?tab=readme-ov-file#builds-and-usage).

---
_Source: https://npm.io/package/@apimatic/schema · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
