Skip to content

feat(index): add ability to specify title and version from CLI.#258

Merged
erunion merged 8 commits intoreadmeio:mainfrom
garrett-wade:specifyTitleAndVersionAtCLI
Apr 5, 2022
Merged

feat(index): add ability to specify title and version from CLI.#258
erunion merged 8 commits intoreadmeio:mainfrom
garrett-wade:specifyTitleAndVersionAtCLI

Conversation

@garrett-wade
Copy link
Copy Markdown
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
Copy Markdown
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?

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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