Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add common examples / use cases in a examples folder #76

Open
4 tasks
biancarosa opened this issue Feb 26, 2019 · 6 comments
Open
4 tasks

Add common examples / use cases in a examples folder #76

biancarosa opened this issue Feb 26, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@biancarosa
Copy link
Contributor

Issue Description

At the moment, we have just simple examples but by using the plugin for half a year, we came across some complex use cases that would be worthy to share.

Expected Behavior

We should have more examples.

Checklist

  • Example with just key transforming
  • Example with variable injection from nginx context
  • Example with nullable fields
  • Example with optional fields
@biancarosa biancarosa added the enhancement New feature or request label Feb 26, 2019
@alesc
Copy link

alesc commented Apr 25, 2019

Good idea !
I'm stuck trying to get a valid response_template.
Every example provided in doc return empty response :(
Have you got some example to share already ?

@diegolucasb
Copy link
Contributor

@alesc what is your upstream header property Content-Encoding value?

@cocktailkrabbe
Copy link

@diegolucasb Can confirm this issue. Content-Encoding is gzip.

@PFadel
Copy link
Contributor

PFadel commented Aug 30, 2019

@cocktailkrabbe and @alesc

Sorry for the late response, found out just now.

Try sending the header Accept-Encoding with identity, it should work.

@ktobah
Copy link

ktobah commented Dec 25, 2019

Hi,
Would you guys please help me out. I am in need of using your plugin to transform a json response. However, I am absolutely not able to figure out how to create a template for my json format.
My original response looks like:

{
  "Classified": [
     {
     "ItemID": "1111",
     "Something1": {
         "Field1": "value"
         ... more keys:values
       },
      "Something2": {
          "Field1": "value"
          ... more keys:values
      }
     }
  ]
}

"Classified" is a list of many items. I want to transform this response to:

{
  "Classified": [
     {
     "ItemID": "1111",
     "Zones": [
         {
         "Name": "Something1",
         "Field1": "value",
         ... more keys:values
         },
         {
         "Name": "Something2",
         "Field1": "value",
         ... more keys:values
         }
     ]
     }
  ]
}

Would you please help out with this? I am not also sure if your plugin can handle such structure. Thank you.

@mloskot
Copy link

mloskot commented Feb 23, 2021

The README.md says:

Sometimes the kong bundled request transformer is not enough.

which is a bit vague and it would be helpful if this statement is accompanied with example(s) of such times the "Sometimes" refers to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants