https://github.com/anderseknert/opa-data-schema
Demo of schema based type checking of data
https://github.com/anderseknert/opa-data-schema
Last synced: 4 months ago
JSON representation
Demo of schema based type checking of data
- Host: GitHub
- URL: https://github.com/anderseknert/opa-data-schema
- Owner: anderseknert
- Created: 2023-02-13T22:44:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-13T22:47:12.000Z (over 3 years ago)
- Last Synced: 2025-10-10T23:03:39.866Z (10 months ago)
- Language: Open Policy Agent
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# opa-data-schema
Without schema:
```shell
$ opa eval -f pretty -d policy data.policy.bar
{}
```
With schema:
```shell
$ opa eval -f pretty --schema schema -d policy data.policy.bar
1 error occurred: policy/policy.bar.rego:4: rego_type_error: undefined ref: data.policy.foo.decision.bar
data.policy.foo.decision.bar
^
have: "bar"
want (one of): ["reason"]
```