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(index): add ability to specify title and version from CLI. #258

Merged
merged 8 commits into from
Apr 5, 2022

Conversation

garrett-wade
Copy link
Contributor

🧰 What's being changed?

This enhancement:

  • Added two option CLI arguments title and apiVersion
  • Added the updateTitleAndVersion() method to index.js to update the title and version attributes of a swagger or OAS files info object if specified with the added CLI arguments
  • Calls the updateTitleAndVersion() after the base file is confirmed to be loaded

🧬 Testing

Run the following command node bin/swagger-inline __tests__/__fixtures__/project-openapi --base __tests__/__fixtures__/project-openapi/openapiBase.json --title testTitle --apiVersion 2.0 and confirm the title and version attributes of the info object in the outputted swagger/oas.json file are testTitle and 2.0 respectively based on the CLI input.

Copy link
Member

@erunion erunion left a comment

Choose a reason for hiding this comment

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

mostly just a few small nits, but this looks great! can you run npm run prettier and npm run lint and resolve any issues that that finds?

__tests__/cli.test.js Outdated Show resolved Hide resolved
src/cli.js Outdated Show resolved Hide resolved
src/cli.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Show resolved Hide resolved
garrett-wade and others added 6 commits April 5, 2022 15:36
Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
@garrett-wade
Copy link
Contributor Author

@erunion ran prettier and lint, there is one linting error I cannot figure out how to avoid without turning if off. Any suggestions here: 105:7 error Assignment to property of function parameter 'baseObj' no-param-reassign

@erunion
Copy link
Member

erunion commented Apr 5, 2022

@erunion ran prettier and lint, there is one linting error I cannot figure out how to avoid without turning if off. Any suggestions here: 105:7 error Assignment to property of function parameter 'baseObj' no-param-reassign

With the case you're doing that line it's safe to add an eslint-ignore comment above it

@garrett-wade
Copy link
Contributor Author

@erunion should be good to go, thanks for the feedback!

@erunion erunion merged commit b767dec into readmeio:main Apr 5, 2022
@erunion
Copy link
Member

erunion commented Apr 5, 2022

Published to 5.3.0. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants