apim-cli icon indicating copy to clipboard operation
apim-cli copied to clipboard

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

Open jonatiao opened this issue 2 years ago • 3 comments

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 avatar Aug 02 '23 16:08 jonatiao

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

rathnapandi avatar Aug 04 '23 02:08 rathnapandi

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?

jonatiao avatar Aug 04 '23 11:08 jonatiao