모킹 정책 구성 참조
모킹 정책 구성 참조 (Mocking Policy Configuration Reference)
이 문서는 모킹 정책(Mocking Policy)에서 설정할 수 있는 구성 옵션을 모두 정리한 참조 자료예요. API 명세 파일을 지정하는 방법부터 응답 지연 시간 범위, 무작위 상태 코드나 예시 선택 같은 세부 동작까지 파라미터별로 설명해요. 각 항목마다 타입과 기본값이 함께 표시되어 있어서 DB-less나 하이브리드 모드 여부에 맞게 설정값을 작성할 때 그대로 참고하면 좋아요
출처: 문서
본문
{
"properties": {
"config": {
"type": "object",
"properties": {
"custom_base_path": {
"type": "string",
"description": "The base path to be used for path match evaluation. This value is ignored if `include_base_path` is set to `false`."
},
"max_delay_time": {
"type": "number",
"description": "The maximum value in seconds of delay time. Set this value when `random_delay` is enabled and you want to adjust the default. The value must be greater than the `min_delay_time`.",
"default": 1
},
"min_delay_time": {
"type": "number",
"description": "The minimum value in seconds of delay time. Set this value when `random_delay` is enabled and you want to adjust the default. The value must be less than the `max_delay_time`.",
"default": 0.001
},
"included_status_codes": {
"type": "array",
"items": {
"type": "integer"
},
"description": "A global list of the HTTP status codes that can only be selected and returned."
},
"include_base_path": {
"type": "boolean",
"description": "Indicates whether to include the base path when performing path match evaluation.",
"default": false
},
"api_specification_filename": {
"type": "string",
"description": "The path and name of the specification file loaded into Kong Gateway's database. You cannot use this option for DB-less or hybrid mode."
},
"api_specification": {
"type": "string",
"description": "The contents of the specification file. You must use this option for hybrid or DB-less mode. You can include the full specification as part of the configuration. In Kong Manager, you can copy and paste the contents of the spec directly into the `Config.Api Specification` text field."
},
"random_delay": {
"type": "boolean",
"description": "Enables a random delay in the mocked response. Introduces delays to simulate real-time response times by APIs.",
"default": false
},
"random_examples": {
"type": "boolean",
"description": "Randomly selects one example and returns it. This parameter requires the spec to have multiple examples configured.",
"default": false
},
"random_status_code": {
"type": "boolean",
"description": "Determines whether to randomly select an HTTP status code from the responses of the corresponding API method. The default value is `false`, which means the minimum HTTP status code is always selected and returned.",
"default": false
}
}
}
}
}
관련 리소스
더 알아보기 (Learn more)
- 정책 엔티티의 기본 구조와 공통 필드를 먼저 이해하면 이 구성 참조를 읽기가 훨씬 쉬워요 — AI Policy entity
- 같은 정책 체계로 동작하는 시맨틱 캐시 정책의 구성 방식도 함께 참고하면 도움이 돼요 — AI Semantic Cache Policy
- 요청 제한 정책 문서를 보면 정책별 설정 스키마가 어떻게 구성되는지 감을 잡을 수 있어요 — AI Rate Limiting Advanced Policy