Skip to content

Create API review for CADL from CADL pull request #4924

Closed

Description

Create API review automatically from PR for CADL changes.

Below are the steps to create API review for CADL.

  1. Install CADL compiler and CADL APIreview parser

    npm install -g @cadl-lang/compiler@0.37.0
    npm install -g @azure-tools/cadl-apiview@0.3.0

  2. Change working directory to CADL package root in specific folder as in below e.g. and run following commands to install dependencies and compile CADL
    For .g. https://github.com/Azure/azure-rest-api-specs/tree/feature/confidentialledger/cadl/specification/confidentialledger/ConfidentialLedger

    npm install
    cadl compile . --emit=@azure-tools/cadl-apiview

  3. Step Adding status badges #2 should create a JSON file in output path within package root.
    ./ cadl-output/apiview.json

  4. Rename apiview.json to .json and publish it as artifact. In this case file should be renamed as ConfidentialLedger.json. @Travis Prescott Can Parser generate APIView file with a name matching package root path? APIView will show same name for all reviews without this naming change.

  5. Send REST API to APIView to create API review using same REST API used for Swagger API review. Only difference is that there won’t be any baseline name parameter in request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

APIViewTypeSpecIssues or feature requests for tooling to support TypeSpec (Cadl)

Type

No type

Projects

  • Status

    ✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions