Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"_format_version": "3.0",
"services": [
{
"host": "localhost",
"id": "b69ec2b7-0b2b-5e52-8e37-7126b9237f56",
"name": "test-service",
"path": "/",
"plugins": [],
"port": 443,
"protocol": "https",
"routes": [
{
"id": "04fe9734-c93d-59bc-8723-528a778996c3",
"methods": [
"GET"
],
"name": "test-service_sample-group-sample-service-sample-api-v1-get-result_get",
"paths": [
"~/sample-group/sample-service/sample-api/v1/get-result$"
],
"plugins": [
{
"config": {
"parameter_schema": [
{
"explode": false,
"in": "header",
"name": "env",
"required": true,
"schema": "{\"type\":\"string\"}",
"style": "simple"
}
],
"version": "draft4"
},
"enabled": true,
"id": "8384b338-2d12-5035-902c-a20fd9ddd6fb",
"name": "request-validator",
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-operation-parameter-schema.yaml"
]
}
],
"regex_priority": 200,
"strip_path": false,
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-operation-parameter-schema.yaml"
]
},
{
"id": "a9452a70-c0fe-5a3b-8446-c329ba5c55e2",
"methods": [
"OPTIONS"
],
"name": "test-service_sample-group-sample-service-sample-api-v1-get-result_options",
"paths": [
"~/sample-group/sample-service/sample-api/v1/get-result$"
],
"plugins": [],
"regex_priority": 200,
"strip_path": false,
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-operation-parameter-schema.yaml"
]
}
],
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-operation-parameter-schema.yaml"
]
}
],
"upstreams": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
openapi: 3.0.0

info:
description: Test service
version: 1.0.0
title: Test Service

x-kong-plugin-request-validator:
enabled: true

paths:
/sample-group/sample-service/sample-api/v1/get-result:
get:
parameters:
- in: header
name: env
required: true
schema:
type: string
enum:
- qa
summary: Get Results
description: Get Results.
responses:
"200":
description: The request has succeeded.
options:
responses:
"200":
description: Generic OPTIONS response
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"_format_version": "3.0",
"services": [
{
"host": "localhost",
"id": "b69ec2b7-0b2b-5e52-8e37-7126b9237f56",
"name": "test-service",
"path": "/",
"plugins": [],
"port": 443,
"protocol": "https",
"routes": [
{
"headers": {
"env": [
"qa"
]
},
"id": "4c11d945-2325-5817-9249-2a1973c229af",
"methods": [
"GET"
],
"name": "test-service_sample-group-sample-service-sample-api-v1-get-result_get_0",
"paths": [
"~/sample-group/sample-service/sample-api/v1/get-result$"
],
"plugins": [
{
"config": {
"parameter_schema": [
{
"explode": false,
"in": "header",
"name": "env",
"required": true,
"schema": "{\"enum\":[\"qa\"],\"type\":\"string\"}",
"style": "simple"
}
],
"version": "draft4"
},
"enabled": true,
"id": "8384b338-2d12-5035-902c-a20fd9ddd6fb",
"name": "request-validator",
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-path-operation-parameter-schema.yaml"
]
}
],
"regex_priority": 200,
"strip_path": false,
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-path-operation-parameter-schema.yaml"
]
},
{
"headers": {
"env": [
"dev"
]
},
"id": "13fe35c4-9665-5433-8d0b-a840713d32db",
"methods": [
"OPTIONS"
],
"name": "test-service_sample-group-sample-service-sample-api-v1-get-result_options_0",
"paths": [
"~/sample-group/sample-service/sample-api/v1/get-result$"
],
"plugins": [
{
"config": {
"parameter_schema": [
{
"explode": false,
"in": "header",
"name": "env",
"required": true,
"schema": "{\"enum\":[\"dev\"],\"type\":\"string\"}",
"style": "simple"
}
],
"version": "draft4"
},
"enabled": true,
"id": "eb7440df-3f27-5647-bab9-fec82845e2b9",
"name": "request-validator",
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-path-operation-parameter-schema.yaml"
]
}
],
"regex_priority": 200,
"strip_path": false,
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-path-operation-parameter-schema.yaml"
]
}
],
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-path-operation-parameter-schema.yaml"
]
}
],
"upstreams": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
openapi: 3.0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this file already covers both parameter at both path and operation levels, do we need additional individual tests for same?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have discussed this offline. Please check and verify on this once.


info:
description: Test service
version: 1.0.0
title: Test Service

x-kong-plugin-request-validator:
enabled: true

paths:
/sample-group/sample-service/sample-api/v1/get-result:
parameters:
- in: header
name: env
required: true
schema:
type: string
enum:
- dev
get:
parameters:
- in: header
name: env
required: true
schema:
type: string
enum:
- qa
summary: Get Results
description: Get Results.
responses:
"200":
description: The request has succeeded.
options:
responses:
"200":
description: Generic OPTIONS response
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"_format_version": "3.0",
"services": [
{
"host": "localhost",
"id": "b69ec2b7-0b2b-5e52-8e37-7126b9237f56",
"name": "test-service",
"path": "/",
"plugins": [],
"port": 443,
"protocol": "https",
"routes": [
{
"headers": {
"env": [
"qa"
]
},
"id": "8377d503-1bba-522a-a206-f91323442674",
"methods": [
"GET"
],
"name": "test-service_sample-group-sample-service-sample-api-v2-get-result_get_0",
"paths": [
"~/sample-group/sample-service/sample-api/v2/get-result$"
],
"plugins": [
{
"config": {
"parameter_schema": [
{
"explode": false,
"in": "header",
"name": "env",
"required": true,
"schema": "{\"enum\":[\"qa\"],\"type\":\"string\"}",
"style": "simple"
}
],
"version": "draft4"
},
"enabled": true,
"id": "ddb9f3cc-b11a-58f2-87e0-e47d8eca0242",
"name": "request-validator",
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-path-parameter-schema.yaml"
]
}
],
"regex_priority": 200,
"strip_path": false,
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-path-parameter-schema.yaml"
]
},
{
"headers": {
"env": [
"qa"
]
},
"id": "c7f298fd-0673-5232-838c-d51a17edb71e",
"methods": [
"OPTIONS"
],
"name": "test-service_sample-group-sample-service-sample-api-v2-get-result_options_0",
"paths": [
"~/sample-group/sample-service/sample-api/v2/get-result$"
],
"plugins": [
{
"config": {
"parameter_schema": [
{
"explode": false,
"in": "header",
"name": "env",
"required": true,
"schema": "{\"enum\":[\"qa\"],\"type\":\"string\"}",
"style": "simple"
}
],
"version": "draft4"
},
"enabled": true,
"id": "1da08580-9237-584f-8213-9d64c1a87782",
"name": "request-validator",
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-path-parameter-schema.yaml"
]
}
],
"regex_priority": 200,
"strip_path": false,
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-path-parameter-schema.yaml"
]
}
],
"tags": [
"OAS3_import",
"OAS3file_26-request-validator-plugin-path-parameter-schema.yaml"
]
}
],
"upstreams": []
}
Loading
Loading