본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Response Transformer Advanced 플러그인 설정 참조

원문 보기 위키 갱신

Response Transformer Advanced 플러그인 설정 참조 (Response Transformer Advanced Plugin Configuration Reference)

이 문서는 Kong의 Response Transformer Advanced 플러그인 설정을 상세히 설명해요. JSON 형식으로 구성 가능한 add, append, remove, allow 등의 속성을 다루며, 헤더나 JSON 본문을 변환하는 방법을 알려줘요. 특히 dots_in_keys 옵션으로 중첩 JSON 객체 접근 방식을 제어할 수 있어요.

출처: 문서

본문

{
  "properties": {
    "config": {
      "properties": {
        "add": {
          "properties": {
            "headers": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "if_status": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "json": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "json_types": {
              "default": [],
              "items": {
                "enum": [
                  "boolean",
                  "number",
                  "string"
                ],
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object"
        },
        "allow": {
          "properties": {
            "json": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object"
        },
        "append": {
          "properties": {
            "headers": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "if_status": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "json": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "json_types": {
              "default": [],
              "items": {
                "enum": [
                  "boolean",
                  "number",
                  "string"
                ],
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object"
        },
        "dots_in_keys": {
          "default": true,
          "description": "Whether dots (for example, `customers.info.phone`) should be treated as part of a property name or used to descend into nested JSON objects..",
          "type": "boolean"
        },
        "remove": {
          "properties": {
            "headers": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "if_status": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "json": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object"
        },
        "rename": {
          "properties": {
            "headers": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "if_status": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object"
        },
        "replace": {
          "properties": {
            "body": {
              "description": "String with which to replace the entire response body.",
              "type": "string"
            },
            "headers": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "if_status": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "json": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "json_types": {
              "default": [],
              "items": {
                "enum": [
                  "boolean",
                  "number",
                  "string"
                ],
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object"
        },
        "transform": {
          "properties": {
            "functions": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "if_status": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "json": {
              "default": [],
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "consumer": {
      "additionalProperties": false,
      "description": "If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "consumer_group": {
      "additionalProperties": false,
      "description": "If set, the plugin will activate only for requests where the specified consumer group has been authenticated. (Note that some plugins can not be restricted to consumers groups this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer Groups",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "expressions": {
      "additionalProperties": true,
      "type": "object"
    },
    "protocols": {
      "default": [
        "grpc",
        "grpcs",
        "http",
        "https"
      ],
      "description": "A set of strings representing HTTP protocols.",
      "items": {
        "enum": [
          "grpc",
          "grpcs",
          "http",
          "https"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "route": {
      "additionalProperties": false,
      "description": "If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "service": {
      "additionalProperties": false,
      "description": "If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}

관련 리소스

더 알아보기 (Learn more)