readmeio / rdme

ReadMe's official command-line interface (CLI) and GitHub Action 🌊

Home Page:https://docs.readme.com/main/docs/rdme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

new CLI openapi: reduce option to change the "title" and consequently the "category" in API Reference

janiksam opened this issue · comments

Hello team,

Our openapi file size requires us to use the openapi:reduce method in order to successfully upload the OpenAPI using Github Actions.

I would like to request an option in the openapi:reduce method to change the title of the info object in the reduced file. The reason is that each time I sync using the openapi:reduce method, the category in readme API reference gets changed to the value defined in title.

"info": {
    {
        "title": "Reduced File Title that becomes the Category Name in API Reference"
        "version": ...
    }
}

I tried changing the category name in readme's Dashboard, but the change is overwritten during the syncing process.

Suggestion:

  • --title "Category Title"
  • --category "Category Title"

Something along the lines of

- name: GitHub Action
        uses: readmeio/rdme@v8.3.0
        with:
          rdme: openapi:reduce ./reference/OpenAPI.json --path /metadata-schemas --method get --title "Metadata Schemas API" --out OpenAPI-reduced-metadata-schemas-api.json

Please let me know if you need any additional information. We would greatly appreciate your help.

Thanks!

Or another idea/option is to include this option on the --create method. This way when I call the syncing for the first time with readme, the category name persists and does not change each time I will sync a reduced file back to the title parameter.

commented

I've hit the same quirk, so would appreciate a change to reduce.

Appreciate the context @janiksam! I added a title flag to both the openapi and openapi:reduce commands to set the info.title field. Will tag a release with this change in the next day or two!