ERROR: $ref Invalid model specified: [Model reference must be in canonical form] [API Gateway: Models]

0

A 2018 tutorial shows this as working (I'm new to AWS), but I get the following error when using $ref in API Gateway > Models:

**ERROR: Invalid model specified: [Model reference must be in canonical form] **

{
    "type": "array",
    "items":{
      "$ref":"https://api.gateway.amazonaws.com/restapis/evwngv01/models/MusicItem" 
    }  
}

From the 2018 Tutorial: Enter image description here

I checked these docs, tried using ""Ref" instead, but that didnt work. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html

Thanky ou.

1개 답변
2

It appears the URL is not in the correct format in your ref. The format is:

"$ref": "https://apigateway.amazonaws.com/restapis/{restapi_id}/models/{model_name}"

Note, that there is a '.' between api and gateway that shouldn't be there. Also check that the ID of your REST API is correct, is 'evwngv01' the ID of the REST API you have created.

"$ref":"https://api.gateway.amazonaws.com/restapis/evwngv01/models/MusicItem"

AWS
Steve
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠