Forum Discussion

blackwj's avatar
blackwj
New Contributor
6 years ago

{proxy+} swagger definitions

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

6 Replies

  • 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.

    • sandeepilania's avatar
      sandeepilania
      New Contributor

      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

      • RonRatovsky's avatar
        RonRatovsky
        Moderator

        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.