Skip to content
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

feat(openapi): exposing our spec conversion tooling to a new :convert command #717

Merged
merged 9 commits into from
Dec 19, 2022

Conversation

erunion
Copy link
Member

@erunion erunion commented Dec 19, 2022

🧰 Changes

This exposes our internal Swagger and Postman spec conversion work that we do into a new openapi:convert command as it may be be useful to have outside of the context of regular spec uploading and validation.

It works the same as our other openapi:* commands and prompts you for specs, accepts a working directory, and has an --out argument for storing the converted spec.

🧬 QA & Testing

npx ts-node openapi:convert

@erunion erunion added enhancement New feature or request command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands labels Dec 19, 2022
@erunion erunion requested a review from kanadgupta December 19, 2022 20:20
@erunion erunion marked this pull request as ready for review December 19, 2022 20:20
Copy link
Member

@kanadgupta kanadgupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly small comments but this looks good for the most part!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/cmds/openapi/convert.ts Show resolved Hide resolved
src/lib/logger.ts Show resolved Hide resolved
src/lib/prepareOas.ts Outdated Show resolved Hide resolved
src/cmds/openapi/convert.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@erunion erunion requested a review from kanadgupta December 19, 2022 21:30
this.definitionVersion = definitionVersion.version;
const parsedBundledSpec = JSON.parse(bundledSpec);
const parsedPreparedSpec = JSON.parse(preparedSpec);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would have been hilarious if it was called parsedStringifiedSpec

@erunion erunion merged commit 0482a1f into main Dec 19, 2022
@erunion erunion deleted the feat/openapi-convert branch December 19, 2022 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants