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: add command line to convert files #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the CLI functionality by installing the repo and then ran the following tests:
-
npm test
45 passing (all) - check that help messages work properly for the package and the convert command
- tested the convert command in REPL using the basic example described in the README
const schema = {
'$schema': 'http://json-schema.org/draft-04/schema#',
type: ['string', 'null'],
format: 'date-time',
const convert = require('@openapi-contrib/json-schema-to-openapi-schema');
(async () => {
const convertedSchema = await convert(schema);
console.log(convertedSchema);
})();
// returned
{ type: 'string', format: 'date-time', nullable: true }
};
- converted the "basic" and "address" examples and verified they match the OpenAPI provided for each by using:
npx json-schema-to-openapi-schema convert address/json-schema.json > address/address-oas.json
Everything looks good to me, I would just correct the one typo described in the comment and approve
bin/help-text.json
Outdated
], | ||
"convert": [ | ||
"Converts JSON Schema Draft 04 to OpenAPI 3.0 Schema Object.", | ||
"Returns a non-zero exit code if convertion fails.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested both help messages and everything looks good. Just found one typo: "convertion" should be corrected to "conversion".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I fixed this issue and amend the latest commit. Thanks!
🎉 This PR is included in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Done! Thank you for this amazing work.
Hopefully you won’t need it for long and can get up to OpenAPI v3.1 instead of having to convert stuff, but until everyone is upgraded many people will be grateful for this.
…On Thu, Jul 29, 2021 at 09:57, github-actions[bot] ***@***.***> wrote:
🎉 This PR is included in version 2.1.0 🎉
The release is available on:
- [npm package ***@***.*** ***@***.***/json-schema-to-openapi-schema/v/2.1.0)
- [GitHub release](https://github.com/openapi-contrib/json-schema-to-openapi-schema/releases/tag/v2.1.0)
Your [semantic-release](https://github.com/semantic-release/semantic-release) bot 📦🚀
—
You are receiving this because you modified the open/close state.
Reply to this email directly, [view it on GitHub](#24 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAAQONNVTCVMPUGTUGCI6MTT2ECYBANCNFSM5A6S77KA).
|
This PR introduces a command-line option to this package.
Thanks!