Hi I've been trying to use the AWS generic proxy swagger open API definition from the AWS site and it always gives the error 'Declared path parameter "proxy+" needs to be defined as a path parameter at either the path or operation level' Below is the definition. What's the issue?
openapi: 3.0.0 info: version: '2016-09-12T23:19:28Z' title: PetStoreWithProxyResource paths: '/{proxy+}': x-amazon-apigateway-any-method: parameters: - name: proxy in: path required: true schema: type: string responses: {} x-amazon-apigateway-integration: responses: default: statusCode: '200' requestParameters: integration.request.path.proxy: method.request.path.proxy uri: 'http://petstore-demo-endpoint.execute-api.com/petstore/{proxy}' passthroughBehavior: when_no_match httpMethod: ANY cacheNamespace: rbftud cacheKeyParameters: - method.request.path.proxy type: http_proxy servers: - url: 'https://4z9giyi2c1.execute-api.us-east-1.amazonaws.com/{basePath}' variables: basePath: default: /test
The issue is that the name of the parameter is 'proxy' but the path is defined as /{proxy+} suggesting that the name of the parameter is 'proxy+' One of those needs to be changed.
Hi Ron,
As suggested, I did change name to proxy+ but i am stilling getting the same error
openapi: 3.0.0
info:
version: '2016-09-12T23:19:28Z'
title: PetStoreWithProxyResource
paths:
'/{proxy+}':
x-amazon-apigateway-any-method:
parameters:
- name: proxy+
in: path
required: true
schema:
type: string
responses: {}
x-amazon-apigateway-integration:
responses:
default:
statusCode: '200'
requestParameters:
integration.request.path.proxy: method.request.path.proxy
uri: 'http://petstore-demo-endpoint.execute-api.com/petstore/{proxy}'
passthroughBehavior: when_no_match
httpMethod: ANY
cacheNamespace: rbftud
cacheKeyParameters:
- method.request.path.proxy
type: http_proxy
servers:
- url: 'https://4z9giyi2c1.execute-api.us-east-1.amazonaws.com/{basePath}'
variables:
basePath:
default: /test
Can you please edit the reply or add a new one with the API definition appearing in a code block? Otherwise the indentation is lost which is critical to understanding possible issues. Thanks.
openapi: 3.0.0 info: version: '2016-09-12T23:19:28Z' title: PetStoreWithProxyResource paths: '/{proxy+}': x-amazon-apigateway-any-method: parameters: - name: proxy+ in: path required: true schema: type: string responses: {} x-amazon-apigateway-integration: responses: default: statusCode: '200' requestParameters: integration.request.path.proxy: method.request.path.proxy uri: 'http://petstore-demo-endpoint.execute-api.com/petstore/{proxy}' passthroughBehavior: when_no_match httpMethod: ANY cacheNamespace: rbftud cacheKeyParameters: - method.request.path.proxy type: http_proxy servers: - url: 'https://4z9giyi2c1.execute-api.us-east-1.amazonaws.com/{basePath}' variables: basePath: default: /test
The parameters aren't really defined under the operation, but under the extension 'x-amazon-apigateway-any-method'. This may be good for AWS but it's not how the specification works. The parameters need to be defined directly under the path '/{proxy+}'.
hi ron,
can give provide me a working example where you have used {proxy+} path in swagger definition. Because i am not able to get through that error still.
Subject | Author | Latest Post |
---|---|---|