cedar-policy / cedar

Implementation of the Cedar Policy Language
https://www.cedarpolicy.com
Apache License 2.0
892 stars 80 forks source link

Running `cedar new --name anything` generates a file named "schema.cedarschema.json" #1259

Closed maxprofit closed 1 month ago

maxprofit commented 1 month ago

Before opening, please confirm:

Bug Category

Other

Describe the bug

I think this schema.cedarschema.json might be a typo? The generated file is obviously in JSON. I feel like it should be just named schema.json with a cedar version as schema.cedar or schema.cedarschema. I didn't see anything on the cedarpolicy website so I could be off on which extension should be used.

Expected behavior

I'd expect it to be named schema.json or have it generated as schema.cedar to match the policy.cedar file

Reproduction steps

  1. Install the CLI
  2. run cedar new --name whatever
  3. Inspect resulting directory
  4. Find the oddly named json file

Code Snippet

// Put your code below this line.
let schema_path = dir.join("schema.cedarschema.json");

https://github.com/cedar-policy/cedar/blob/9b45bae3c48c1c0ba1354626cb4c118d906582dd/cedar-policy-cli/src/lib.rs#L1023

Log output

N/A

Additional configuration

No response

Operating System

MacOS

Additional information and screenshots

No response

maxprofit commented 1 month ago

I think I just didn't realize that this was the proper extension, as referenced in the examples. I feel like I was driven to this confusion by the fact that policy files have the extension as *.cedar and schema files have the extension *.cedarschema