Skip to content

OpenAPI Spec Linting #1

OpenAPI Spec Linting

OpenAPI Spec Linting #1

Workflow file for this run

name: Validate API Spec
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
typescript_api_spec_validation:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 'latest'
- name: Install tsp
run: npm install -g @typespec/[email protected]
- name: Install dependencies
run: npm install \
@typespec/[email protected] \
@typespec/[email protected] \
@typespec/[email protected] \
@typespec/[email protected] \
@typespec/[email protected] \
@azure-tools/[email protected] \
@azure-tools/[email protected] \
@azure-tools/[email protected]
- name: Install oav
run: npm install -g oav@latest
- name: Compile tsp
run: tsp compile ./api/redhatopenshift/HcpCluster
- name: Generate OpenAPI Spec
run: oav generate-examples ./api/redhatopenshift/resource-manager/Microsoft.RedHatOpenshift/preview/2024-06-10-preview/openapi.json
- name: Check for Uncommitted Changes
run: |
git diff --exit-code || (echo "::error::Uncommitted changes detected in OpenAPI spec. Please regenerate and commit them." && exit 1)