Add Swagger 2.0 support and custom spec URL for api cloud by jeremybeard · Pull Request #2040 · astronomer/astro-cli
- Add Swagger 2.0 (OpenAPI 2.x) parsing support alongside existing OpenAPI 3.x. The spec version is auto-detected and the appropriate model is built. Swagger 2.0 body parameters are converted to RequestBody and responses are mapped with synthetic content types. - Add --spec-url flag on `astro api cloud` to override the default Cloud API spec URL. The base URL for requests is derived from the spec's servers/basePath combined with the current context domain. - Add --spec-token-env-var flag to provide an env var name containing an auth token for fetching specs that require authentication. - Add GetServerPath() to extract the API base path from either v3 servers[0].url or v2 basePath. - Fix circular $ref stack overflow in schema conversion by returning ref names without resolving into BuildSchema(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
marked this pull request as ready for review
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