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

Pls make apiMethods's summary and descriptionType not mandatory so the original is used by default #423

Open
jonatiao opened this issue Aug 2, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@jonatiao
Copy link

jonatiao commented Aug 2, 2023

Problem description

Currently the summary and descriptionType are sort of mandatory for the apiMethods flags.

 "apiMethods": [
    {
      "name": "createUser",
      "summary": "Create user",
      "descriptionType": "original",
      "tags": {
        "stage": [
          "dev"
        ]
      }
    },
    {
      "name": "logoutUser",
      "summary": "Logs out current logged in user session",
      "descriptionType": "original",
      "tags": {
        "stage": [
          "dev"
        ]
      }
    }
  ]

Which is kind of odd.
I mean, if I do not set the descriptionType in api-config.json, apicli tells me it's mandatory, should not be null, and if I want to default, I should set to "original". Well, can't we just make it consider using "original" instead of throwing an exception?

The summary is worst, if I do not set it in api-config.json, the summary in the APi is overwriten by empty. apimcli does not complain or have support for a "original".

Feature request

Can we please make apiMethods to change only what we ask for it to change?
For instance, if we declare:

 "apiMethods": [
    {
      "name": "createUser",
      "tags": {
        "stage": [
          "dev"
        ]
      }
    }
  ]

Only the tag stage will be added to the createUser method and nothing else is touched for instance.
I would be nice to have something like this for updating single methods.

thx!

@jonatiao jonatiao added the enhancement New feature or request label Aug 2, 2023
@rathnapandi rathnapandi self-assigned this Aug 2, 2023
@rathnapandi
Copy link
Member

Hi @jonatiao,

From 1.14.1 api method's summary is not mandatory. Can you let me know the version you tested with?

Also, we are detecting changes based on what is available in config file and API manager, without that it will hard find out if the changes are going to be breaking or not. If it is breaking change, the cli will throw an error but we can force it with force flag.

Thanks
Rathna

@jonatiao
Copy link
Author

jonatiao commented Aug 4, 2023

Hello @rathnapandi :)
Oh sorry, maybe I was not clear regarding the 'summary'.. what I was trying to say is that the summary is not mandatory in apimcli and that's a problem because if we do not declare it in api-config.json then the method's summary gets overwriten to empty, I mean, it removes what we have there.
My request is.. cant we make summary and descriptiontype optional in the api-config.json and keep the values we have orginally there in the method already somehow?

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

No branches or pull requests

2 participants