bcgov / gwa-cli

Apache License 2.0
6 stars 1 forks source link

Better error message for invalid namespace creation with GWA CLI #86

Closed nirajCITZ closed 10 months ago

nirajCITZ commented 11 months ago

As a api-owner, GWA CLI should be able to display error message regarding the namespace name logic When I attempt to create a namespace with invalid name So that I create a namespace with correct format

Jonesy commented 11 months ago

@nirajCITZ can you add the current input and error message you're getting?

ikethecoder commented 10 months ago

A response the from the API for an invalid name is:

{
  "message": "Validation Failed",
  "details": {
    "d0": {
      "message": "Namespace name must be between 5 and 15 alpha-numeric lowercase characters and start and end with an alphabet."
    }
  }
}

Where the keys under details are field references (so in this case d0 is regarded as a field... so the display in the CLI might be something like:

Error: Validation Failed
   d0: Namespace name must be between 5 and 15 alpha-numeric lowercase characters and start and end with an alphabet.