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

[Feature Request] Non-interactive Reduction of an OpenAPI Definition #683

Closed
serverlessmike opened this issue Nov 30, 2022 · 1 comment · Fixed by #684
Closed

[Feature Request] Non-interactive Reduction of an OpenAPI Definition #683

serverlessmike opened this issue Nov 30, 2022 · 1 comment · Fixed by #684
Labels
command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands enhancement New feature or request

Comments

@serverlessmike
Copy link

Background

GitHub Action: readmeio/[email protected]

Any linux runner, any OpenAPI 3+ definition

Observation

I have multiple APIs which have operations that can either be public or private. I'm currently tagging the operations in the definition to distinguish between the two use cases.

    get:
      description: Get a list of pets in stock
      tags:
        - public

  /update-inventory:
    post:
      description: Internal endpoint used to update pet inventory
      tags:
        - private

With rdme 8.0 onwards I can reduce the definition and just publish to my developer portal the public definitions.
rdme openapi:reduce <filename>
Happy days.

However, the openapi:reduce command is for interactive use only. My CI pipelines are non-interactive, so can't perform the same task. This breaks the mantra "Our CLI and GitHub actions have the same functionality", which is both bogus and sad.

Request

Enhance the openapi:reduce command to accept a tag on the command line. How you deal with the question of where to write the resulting file is up to you, but if it were me I'd probably write to stdout.

@kanadgupta kanadgupta added enhancement New feature or request command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands labels Nov 30, 2022
@kanadgupta
Copy link
Member

Hey @serverlessmike, appreciate your interest in openapi:reduce!

I just tagged a beta release (GitHub, NPM, usage docs) with the changes. The openapi:reduce command now supports all the flags one would need to run it in a CI pipeline. Hope this makes your days a little happier 🥳

Also — would love to get in touch and hear about you stumbled upon openapi:reduce. Feel free to reach out via email: kanad at readme dot io. Thanks!

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 a pull request may close this issue.

2 participants