Add apim-gen CLI for automated Azure APIM-compatible OpenAPI spec generation#1602
Open
Add apim-gen CLI for automated Azure APIM-compatible OpenAPI spec generation#1602
Conversation
|
Thanks for your contribution. The .json file will be checked now with Spectral. |
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-Claude) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-Claude) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-Claude) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-Claude) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-Claude) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-Claude) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-Claude) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
d5082b7 to
0981a6f
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
apim-genCLI tool that transforms VTEX OpenAPI specs into Azure APIM-compatible versionsProblem
Importing VTEX OpenAPI specs into Azure API Management requires manual patching to work around APIM's strict parser. A colleague manually patched 25+ specs for the Manitou project — this tool automates that process.
Azure APIM Compatibility Issues Solved
{accountName}and{environment}in paths are server variables, not path params. APIM rejects these.remove-false-path-paramsAcceptandContent-Typeas explicit parameters conflict with APIM's handling.remove-paramsremove-pathsensure-operation-idset-openapi-versionsplit-by-prefixcleanup-componentsArchitecture
Usage
First Client: Manitou
clients/manitou/config.yamlGitHub Action
VTEX - *.json), client configs, or tool sourceclients/*/config.yamlfilesTesting
cd tools/apim-gen && npm testCommits
Add apim-gen CLI project setup— package.json, tsconfig, vitest configAdd apim-gen core types and config loader— foundation types and YAML config parserAdd apim-gen OpenAPI transforms— 8 composable transform functionsAdd apim-gen pipeline and CLI entry point— orchestration and CLI interfaceAdd apim-gen tests— 63 tests across 9 test filesAdd Manitou client configuration— first client with 25 spec entriesAdd GitHub Actions workflow for spec generation— CI automationFix workflow to detect new output files and checkout PR head— fix for untracked file detection