在 RAML 1.0、API 平台 2.0 上使用连字符分隔的资源名称“/songs-list”创建 API Notebook 时,会出现以下错误: APINotebook 错误
API.createClient('client', '9c2861a1-b**b-401e-****-1ec*****b20c', 'testhyphen', '1.0.2');
$0=客户端已成功创建
client.songs-list.post[{"msg":"succ"}];
$1=ReferenceError: list is not defined
at eval (eval at <anonymous> (eval at value (https://cdn.anypoint.mulesoft.com/artifacts/exchange-ui/main.efc15523965187f6c807.js:1:998504)), <anonymous>:1:14)
at Object.eval (eval at value (https://cdn.anypoint.mulesoft.com/artifacts/exchange-ui/main.efc15523965187f6c807.js:1:998504), <anonymous>:3:8)
at e.value (https://cdn.anypoint.mulesoft.com/artifacts/exchange-ui/main.efc15523965187f6c807.js:1:998611)
at https://cdn.anypoint.mulesoft.com/artifacts/exchange-ui/main.efc15523965187f6c807.js:1:2212756
at h.run (https://cdn.anypoint.mulesoft.com/artifacts/exchange-ui/main.efc15523965187f6c807.js:1:282445)
at p (https://cdn.anypoint.mulesoft.com/artifacts/exchange-ui/main.efc15523965187f6c807.js:1:281939)
at nrWrapper (https://anypoint.mulesoft.com/exchange/9c2861a1-b**b-401e-****-1ec*****b20c/testhyphen/minor/1.0/:1:24554)
上述资产的 RAML 如下,资源名称为“/songs-list”:
#%RAML 1.0
title: testhyphen
/songs-list:
post:
body:
application/json:
responses:
200:
body:
application/json:
example: {"messgae": "Success"}
如果资源名称不包含“-”(连字符),例如当资源为 -“/songs”时,则 API 笔记本按预期运行。 API Notebook 成功
API.createClient('client', '9c2861a1-b**b-401e-****-1ec*****b20c', 'testset', '1.0.1');
$0=Client has been successfully created
client.songs.post[{"msg":"succ"}];
Code snippet executed with no results