[X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
Bug Category
Schemas and Validation
Describe the bug
The CLI's translate-schema command fails when invoked with a JSON schema and --direction json-to-cedar:
$ cargo run -- translate-schema --schema ~/Downloads/photoflash.cedarschema.json --direction json-to-cedar
warning: /Users/adam.rothman/src/cedar/cedar-policy-core/Cargo.toml: unused manifest key: lints.rust.unexpected_cfgs.check-cfg
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s
Running `/Users/adam.rothman/src/cedar/target/debug/cedar translate-schema --schema /Users/adam.rothman/Downloads/photoflash.cedarschema.json --direction json-to-cedar`
× error parsing schema: unexpected token `{`
help: this API was expecting a schema in the Cedar schema format; did you mean to use a different function, which expects a JSON-format Cedar schema
Expected behavior
The CLI should successfully parse the JSON schema file and output a translation to the human-readable format.
Before opening, please confirm:
Bug Category
Schemas and Validation
Describe the bug
The CLI's
translate-schema
command fails when invoked with a JSON schema and--direction json-to-cedar
:Expected behavior
The CLI should successfully parse the JSON schema file and output a translation to the human-readable format.
For example, it works fine when translating the example human-readable schema to JSON:
Reproduction steps
cedar-policy-cli
directory, runcargo run -- translate-schema --schema ~/Downloads/photoflash.cedarschema.json --direction json-to-cedar
Code Snippet
No response
Log output
No response
Additional configuration
No response
Operating System
macOS Sonoma 14.6.1
Additional information and screenshots
No response