-
Notifications
You must be signed in to change notification settings - Fork 194
TypeSpec migration milestone 1: Generate Swagger from TypeSpec #4791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kimorris27
wants to merge
24
commits into
master
Choose a base branch
from
kimorris27/ARO-23228-typespec-migration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
eb17bfc
Copy TypeSpec files from azure-rest-api-specs and common-types from A…
kimorris27 c35225c
Prepare container image for use in TypeSpec `make` targets
kimorris27 27f8855
Add `make generate-swagger-typespec` and preserve previous `make gene…
kimorris27 ecb8a0a
`make generate` and make `api` the source of truth for the current st…
kimorris27 d6f77f0
Update `make generate` to handle checksums for API versions in new `a…
kimorris27 5eb96c2
Update Swagger generation script and generate CI check to account for…
kimorris27 473ea90
Small fixes
kimorris27 107b49b
Update AI agent docs and add a human doc
kimorris27 eeebf49
Remove containerization of TypeSpec stuff and `make generate-swagger-…
kimorris27 43004df
Case sensitivity fix
kimorris27 d845bbd
Appease yaml linter
kimorris27 1668c50
Various small fixes recommended by Copilot
kimorris27 4e17d67
Add npm audit to CI for the new npm package in the api directory
kimorris27 cc1d2b0
`npm audit fix --force` to get us from 5 moderate vulns to 6 low
kimorris27 336a63d
Remove `generate-swagger-typespec` from `make generate` and add CI to…
kimorris27 1d06957
Add formatting for the TypeSpec to the CI diff check
kimorris27 60ad094
Leverage hacks instead of doing a separate, bespoke thing in this file
kimorris27 5f040da
Remove unused `generate.go` files from `pkg/api` version subdirectories
kimorris27 febe7f7
Try updating node version per Copilot's recommendation
kimorris27 9142253
Quote shell variable usages per Copilot's recommendation
kimorris27 110eb99
Treat path as a fixed pattern rather than interpreting as a regex per…
kimorris27 c4ee148
Remove 2025-07-25 from suppressions since it is generated from TypeSp…
kimorris27 4084e7d
Fix summary for patch
kimorris27 d6feeea
Small doc fixes per Copilot's recommendations
kimorris27 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: ci-api-swagger-diff | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - v* | ||
| branches: | ||
| - master | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| api-swagger-diff-check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | ||
| with: | ||
| node-version: 20.12.0 | ||
| cache: npm | ||
| cache-dependency-path: api/package-lock.json | ||
|
|
||
| - name: Generate from TypeSpec | ||
| run: hack/api/swagger-from-typespec.sh | ||
|
|
||
| - name: Verify no diffs in api or swagger | ||
| run: hack/ci-utils/isClean.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| { | ||
| "swagger": "2.0", | ||
| "info": { | ||
| "version": "1.0", | ||
| "title": "Common types" | ||
| }, | ||
| "paths": {}, | ||
| "definitions": { | ||
| "ErrorDetail": { | ||
| "type": "object", | ||
| "description": "The error detail.", | ||
| "properties": { | ||
| "code": { | ||
| "readOnly": true, | ||
| "type": "string", | ||
| "description": "The error code." | ||
| }, | ||
| "message": { | ||
| "readOnly": true, | ||
| "type": "string", | ||
| "description": "The error message." | ||
| }, | ||
| "target": { | ||
| "readOnly": true, | ||
| "type": "string", | ||
| "description": "The error target." | ||
| }, | ||
| "details": { | ||
| "readOnly": true, | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/ErrorDetail" | ||
| }, | ||
| "x-ms-identifiers": [], | ||
| "description": "The error details." | ||
| }, | ||
| "additionalInfo": { | ||
| "readOnly": true, | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/ErrorAdditionalInfo" | ||
| }, | ||
| "x-ms-identifiers": [], | ||
| "description": "The error additional info." | ||
| } | ||
| } | ||
| }, | ||
| "ErrorResponse": { | ||
| "type": "object", | ||
| "title": "Error response", | ||
| "description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).", | ||
| "properties": { | ||
| "error": { | ||
| "description": "The error object.", | ||
| "$ref": "#/definitions/ErrorDetail" | ||
| } | ||
| } | ||
| }, | ||
| "ErrorAdditionalInfo": { | ||
| "type": "object", | ||
| "properties": { | ||
| "type": { | ||
| "readOnly": true, | ||
| "type": "string", | ||
| "description": "The additional info type." | ||
| }, | ||
| "info": { | ||
| "readOnly": true, | ||
| "type": "object", | ||
| "description": "The additional info." | ||
| } | ||
| }, | ||
| "description": "The resource management error additional info." | ||
| } | ||
| } | ||
| } |
182 changes: 182 additions & 0 deletions
182
api/common-types/resource-management/v1/privatelinks.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,182 @@ | ||
| { | ||
| "swagger": "2.0", | ||
| "info": { | ||
| "version": "1.0", | ||
| "title": "Common types" | ||
| }, | ||
| "paths": {}, | ||
| "definitions": { | ||
| "PrivateEndpoint": { | ||
| "type": "object", | ||
| "properties": { | ||
| "id": { | ||
| "readOnly": true, | ||
| "type": "string", | ||
| "description": "The ARM identifier for Private Endpoint" | ||
| } | ||
| }, | ||
| "description": "The Private Endpoint resource." | ||
| }, | ||
| "PrivateEndpointConnection": { | ||
| "type": "object", | ||
| "properties": { | ||
| "properties": { | ||
| "$ref": "#/definitions/PrivateEndpointConnectionProperties", | ||
| "x-ms-client-flatten": true, | ||
| "description": "Resource properties." | ||
| } | ||
| }, | ||
| "allOf": [ | ||
| { | ||
| "$ref": "./types.json#/definitions/Resource" | ||
| } | ||
| ], | ||
| "description": "The Private Endpoint Connection resource." | ||
| }, | ||
| "PrivateEndpointConnectionProperties": { | ||
| "type": "object", | ||
| "properties": { | ||
| "privateEndpoint": { | ||
| "$ref": "#/definitions/PrivateEndpoint", | ||
| "description": "The resource of private end point." | ||
| }, | ||
| "privateLinkServiceConnectionState": { | ||
| "$ref": "#/definitions/PrivateLinkServiceConnectionState", | ||
| "description": "A collection of information about the state of the connection between service consumer and provider." | ||
| }, | ||
| "provisioningState": { | ||
| "$ref": "#/definitions/PrivateEndpointConnectionProvisioningState", | ||
| "description": "The provisioning state of the private endpoint connection resource." | ||
| } | ||
| }, | ||
| "required": [ | ||
| "privateLinkServiceConnectionState" | ||
| ], | ||
| "description": "Properties of the PrivateEndpointConnectProperties." | ||
| }, | ||
| "PrivateLinkServiceConnectionState": { | ||
| "type": "object", | ||
| "properties": { | ||
| "status": { | ||
| "$ref": "#/definitions/PrivateEndpointServiceConnectionStatus", | ||
| "description": "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service." | ||
| }, | ||
| "description": { | ||
| "type": "string", | ||
| "description": "The reason for approval/rejection of the connection." | ||
| }, | ||
| "actionsRequired": { | ||
| "type": "string", | ||
| "description": "A message indicating if changes on the service provider require any updates on the consumer." | ||
| } | ||
| }, | ||
| "description": "A collection of information about the state of the connection between service consumer and provider." | ||
| }, | ||
| "PrivateEndpointServiceConnectionStatus": { | ||
| "type": "string", | ||
| "description": "The private endpoint connection status.", | ||
| "enum": [ | ||
| "Pending", | ||
| "Approved", | ||
| "Rejected" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "PrivateEndpointServiceConnectionStatus", | ||
| "modelAsString": true | ||
| } | ||
| }, | ||
| "PrivateEndpointConnectionProvisioningState": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "The current provisioning state.", | ||
| "enum": [ | ||
| "Succeeded", | ||
| "Creating", | ||
| "Deleting", | ||
| "Failed" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "PrivateEndpointConnectionProvisioningState", | ||
| "modelAsString": true | ||
| } | ||
| }, | ||
| "PrivateLinkResource": { | ||
| "type": "object", | ||
| "properties": { | ||
| "properties": { | ||
| "$ref": "#/definitions/PrivateLinkResourceProperties", | ||
| "description": "Resource properties.", | ||
| "x-ms-client-flatten": true | ||
| } | ||
| }, | ||
| "allOf": [ | ||
| { | ||
| "$ref": "./types.json#/definitions/Resource" | ||
| } | ||
| ], | ||
| "description": "A private link resource" | ||
| }, | ||
| "PrivateLinkResourceProperties": { | ||
| "type": "object", | ||
| "properties": { | ||
| "groupId": { | ||
| "description": "The private link resource group id.", | ||
| "type": "string", | ||
| "readOnly": true | ||
| }, | ||
| "requiredMembers": { | ||
| "description": "The private link resource required member names.", | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "readOnly": true | ||
| }, | ||
| "requiredZoneNames": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "description": "The private link resource Private link DNS zone name." | ||
| } | ||
| }, | ||
| "description": "Properties of a private link resource." | ||
| }, | ||
| "PrivateEndpointConnectionListResult": { | ||
| "type": "object", | ||
| "properties": { | ||
| "value": { | ||
| "type": "array", | ||
| "description": "Array of private endpoint connections", | ||
| "items": { | ||
| "$ref": "#/definitions/PrivateEndpointConnection" | ||
| } | ||
| } | ||
| }, | ||
| "description": "List of private endpoint connection associated with the specified storage account" | ||
| }, | ||
| "PrivateLinkResourceListResult": { | ||
| "type": "object", | ||
| "properties": { | ||
| "value": { | ||
| "type": "array", | ||
| "description": "Array of private link resources", | ||
| "items": { | ||
| "$ref": "#/definitions/PrivateLinkResource" | ||
| } | ||
| } | ||
| }, | ||
| "description": "A list of private link resources" | ||
| } | ||
| }, | ||
| "parameters": { | ||
| "PrivateEndpointConnectionName": { | ||
| "name": "privateEndpointConnectionName", | ||
| "in": "path", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "The name of the private endpoint connection associated with the Azure resource", | ||
| "x-ms-parameter-location": "method" | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.