OAS 검증 정책 구성 레퍼런스
OAS 검증 정책 구성 레퍼런스 (OAS Validation Policy Configuration Reference)
이 문서는 Kong의 OAS Validation 정책에서 설정할 수 있는 모든 구성 옵션을 JSON 스키마 형태로 정리한 레퍼런스예요. 헤더 파라미터 검사, 베이스 경로 포함 여부, 상세 오류 응답, 응답 본문 검증 같은 각 속성의 의미와 기본값을 한눈에 확인할 수 있어요. Swagger나 OpenAPI로 작성한 API 사양을 기준으로 요청과 응답을 검증하도록 정책을 구성할 때 참고하면 좋아요
출처: 문서
본문
{
"properties": {
"config": {
"type": "object",
"properties": {
"header_parameter_check": {
"type": "boolean",
"description": "If set to true, checks if HTTP header parameters in the request exist in the API specification.",
"default": false
},
"include_base_path": {
"type": "boolean",
"description": "Indicates whether to include the base path when performing path match evaluation.",
"default": false
},
"verbose_response": {
"type": "boolean",
"description": "If set to true, returns a detailed error message for invalid requests & responses. This is useful while testing.",
"default": false
},
"notify_only_request_validation_failure": {
"type": "boolean",
"description": "If set to true, notifications via event hooks are enabled, but request based validation failures don't affect the request flow.",
"default": false
},
"validate_response_body": {
"type": "boolean",
"description": "If set to true, validates the response from the upstream services against the API specification. If validation fails, it results in an `HTTP 406 Not Acceptable` status code.",
"default": false
},
"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`."
},
"notify_only_response_body_validation_failure": {
"type": "boolean",
"description": "If set to true, notifications via event hooks are enabled, but response validation failures don't affect the response flow.",
"default": false
},
"allowed_header_parameters": {
"type": "string",
"description": "List of header parameters in the request that will be ignored when performing HTTP header validation. These are additional headers added to an API request beyond those defined in the API specification. For example, you might include the HTTP header `User-Agent`, which lets servers and network peers identify the application, operating system, vendor, and/or version of the requesting user agent.",
"default": "Host,Content-Type,User-Agent,Accept,Content-Length"
},
"api_spec_encoded": {
"type": "boolean",
"description": "Indicates whether the api_spec is URI-Encoded.",
"default": true
},
"api_spec": {
"type": "string",
"description": "The API specification defined using either Swagger or the OpenAPI. This can be either a JSON or YAML based file. If using a YAML file, the spec needs to be URI-Encoded to preserve the YAML format."
},
"validate_request_body": {
"type": "boolean",
"description": "If set to true, validates the request body content against the API specification.",
"default": true
},
"validate_request_header_params": {
"type": "boolean",
"description": "If set to true, validates HTTP header parameters against the API specification.",
"default": true
},
"validate_request_query_params": {
"type": "boolean",
"description": "If set to true, validates query parameters against the API specification.",
"default": true
},
"query_parameter_check": {
"type": "boolean",
"description": "If set to true, checks if query parameters in the request exist in the API specification.",
"default": false
},
"collect_all_errors": {
"type": "boolean",
"description": "If set to true, collects all validation errors instead of stopping at the first error. Note: Enabling this option with OpenAPI 3.0 will affect performance.",
"default": false
},
"validate_request_uri_params": {
"type": "boolean",
"description": "If set to true, validates URI parameters in the request against the API specification.",
"default": true
}
},
"required": [
"api_spec"
]
}
}
}
더 알아보기 (Learn more)
이 문서에는 원문에서 추출한 별도의 관련 문서 링크가 없어요.