adobe / aio-cli-plugin-runtime

Adobe I/O Runtime plugin for the Adobe I/O CLI
https://www.adobe.io
Apache License 2.0
15 stars 31 forks source link

cosmetic issue: `route list basepath` in aio-cli is not returning the same value when using `wsk` cli #287

Closed shazron closed 1 year ago

shazron commented 1 year ago

Note the difference in the API Name column.

app.config.yaml:

application:
  actions: actions
  runtimeManifest:
    packages:
      my-app:
        license: Apache-2.0
        actions:
          generic:
            function: actions/generic/index.js
            web: 'yes'
            runtime: nodejs:16
            inputs:
              LOG_LEVEL: debug
            annotations:
              require-adobe-auth: false
              final: true
        apis:
          my-api:
            get:
              data:
                generic:
                  method: get

aio-cli:

❯ aio runtime route list get
 Action                                   Verb      API Name  Url
 ──────────────────────────────────────── ─────────  
/53444-shazff8-stage/my-app/generic.json get       /get      https://adobeioruntime.net/apis/53444-shazff8-stage/get/data

wsk cli:

❯ WSK_CONFIG_FILE=.wskprops wsk api list get
ok: APIs
Action                                      Verb  API Name  URL
/53444-shazff8-stage/my-app/generic.json     get    my-api  https://adobeioruntime.net/apis/53444-shazff8-stage/get/data
shazron commented 1 year ago

Fix is to use info.title for API Name instead of basePath:

{
  "basePath": "/get",
  "info": {
    "title": "my-api",
    "version": "1.0.0"
  },
  "paths": {
    "/data": {
      "get": {
        "operationId": "53444-shazff8-stage/my-app/generic.json",
        "responses": {
          "default": {
            "description": "Default response"
          }
        },
        "x-openwhisk": {
          "action": "generic.json",
          "namespace": "53444-shazff8-stage",
          "package": "my-app",
          "url": "not-used"
        }
      }
    }
  },
  "swagger": "2.0"
}
aiojbot commented 1 year ago

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-2103

shazron commented 1 year ago

PR #288