Skip to content

Commit

Permalink
#40: updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mohit-s96 committed Sep 15, 2023
1 parent c2f66bf commit 76dde4c
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions lib/schema/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
## Schema Generation and Validation

### Generate Schema

```bash
$ reso-certification-utils schema --help
$ reso-certification-utils generate --help

Usage: reso-certification-utils schema [options]
Usage: reso-certification-utils generate [options]

Generate a schema or validate a payload against a schema
Generate a schema from a given metadata report

Options:
-g, --generate Generate JSON schema from a metadata report
-v, --validate Validate a payload against a generated schema
-m, --metadataPath <string> Path to the metadata report JSON file
-o, --outputPath <string> Path tho the directory to store the generated schema
-a, --additionalProperties Pass this flag to allow additional properties in the schema
-h, --help Display help for command
```

### Validate payload

```bash
$ reso-certification-utils validate --help

Usage: reso-certification-utils validate [options]

Validate one or more payloads against a schema

Options:
-m, --metadataPath <string> Path to the metadata report JSON file
-p, --payloadPath <string> Path to the payload that needs to be validated
-s, --schemaPath <string> Path to the generated JSON schema
-e, --errorPath <string> Path to save error reports in case of failed validation. Defaults to "./errors"
-a, --additionalProperties Pass this flag to allow additional properties in the schema
-z, --zipFilePath <string> Path to a zip file containing JSON payloads
-h, --help display help for command
-dv, --version <string> The data dictionary version of the metadata report. Defaults to 1.7
-h, --help Display help for command
```
### Generate schema
```bash
reso-certification-utils schema -g -m <path to metadata json file> -o <path to output directory>
```
Expand Down

0 comments on commit 76dde4c

Please sign in to comment.