@rapharacing/schemas
Version:
OpenAPI to JSON Schema to be used with middy for CC response validation
34 lines (20 loc) • 658 B
Markdown
# Middleware Schemas
Middleware Schemas
## Commands
Unfortunately quicktype-core can not infer definition files properly. It also gives useless errors for debugging InputData.
To Generate CC Schemas and Interfaces run the following commands
1. Convert OpenApi to JSON Schema
```sh
$ openapi2jsonschema https://api.c616d-rapharaci1-d1-public.model-t.cc.commerce.ondemand.com/rest/v2/api-docs -o src/schemas
```
2. Build the package
```sh
$ yarn build
```
## How to use
```js
import { getSchema } from "@rapharacing/mw-schemas";
const address = getSchema("address");
```
## To do
Rewrite quicktype util to be used with other schemas (Exponea etc)