Forum Discussion

kaspanoombro's avatar
kaspanoombro
New Contributor
2 years ago

swagger 2.0. parameters in path cannot be reuse in backend call

 
 

I have this path in and endpoint definition in swagger 2.0:

paths:
      /custom_texts/{lang}:
        get:
          parameters:
            - in: path
              name: lang
              required: true
              type: string
          x-backend:
            address: https://another-server.com/translation{lang}

To call it: http://myserver/custom_texts/en but the the backend is called like this: http://myserver/custom_texts/?lang=en

I tried with $request.path.lang but does not worked either? How can i use the value of the lang parameter in the backend call? Thank you.

EDIT I tried with https://swagger.io/docs/specification/callbacks/ But this does not get interpreted:

address: https://another-server.com/translation{$request.query.lang}