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
17 changes: 17 additions & 0 deletions openapi2kong/oas3_testfiles/25-routes-with-headers.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,23 @@
"OAS3_import",
"OAS3file_25-routes-with-headers.yaml"
]
},
{
"id": "27ea9a0a-216e-5c92-ae0b-8c9aa8493750",
"methods": [
"GET"
],
"name": "simple-api-overview_get-path2-service",
"paths": [
"~/path2$"
],
"plugins": [],
"regex_priority": 200,
"strip_path": false,
"tags": [
"OAS3_import",
"OAS3file_25-routes-with-headers.yaml"
]
}
],
"tags": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,46 @@
"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": "f5d69916-9f2e-546a-827a-40c55909a877",
"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"
]
},
{
"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": {
Expand Down Expand Up @@ -69,6 +109,46 @@
"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": "a54b7fcf-7938-5526-8235-1687533d5214",
"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"
]
},
{
"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": [
{
"config": {
Expand Down Expand Up @@ -108,4 +188,4 @@
}
],
"upstreams": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,46 @@
"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": "60c1ec68-951a-5aa6-999b-ab57a3960692",
"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"
]
},
{
"id": "1a1698ae-e685-55b7-b154-33f4b43706b6",
"methods": [
"GET"
],
"name": "test-service_sample-group-sample-service-sample-api-v2-get-result_get",
"paths": [
"~/sample-group/sample-service/sample-api/v2/get-result$"
],
"plugins": [
{
"config": {
Expand Down Expand Up @@ -69,6 +109,46 @@
"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": "26fd997b-a957-544c-a9e7-a394c4e04240",
"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"
]
},
{
"id": "87bb908e-dde6-5396-926e-98c7bc38683f",
"methods": [
"OPTIONS"
],
"name": "test-service_sample-group-sample-service-sample-api-v2-get-result_options",
"paths": [
"~/sample-group/sample-service/sample-api/v2/get-result$"
],
"plugins": [
{
"config": {
Expand Down Expand Up @@ -108,4 +188,4 @@
}
],
"upstreams": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"_format_version": "3.0",
"services": [
{
"host": "server1.com",
"id": "0907c4ab-d9e4-5d21-813b-c57a97eeaad9",
"name": "simple-api-overview",
"path": "/",
"plugins": [],
"port": 443,
"protocol": "https",
"routes": [
{
"headers": {
"X-Path-Level-API-Version": [
"v1"
]
},
"id": "7d086c23-ab4b-567d-969b-356acd50e716",
"methods": [
"GET"
],
"name": "simple-api-overview_get-path2-service_0",
"paths": [
"~/path2$"
],
"plugins": [],
"regex_priority": 200,
"strip_path": false,
"tags": [
"OAS3_import",
"OAS3file_27-routes-with-optional-headers.yaml"
]
},
{
"headers": {
"X-Path-Level-API-Version": [
"v2"
]
},
"id": "433a9a6b-712c-5b47-8c70-64ce872aabea",
"methods": [
"GET"
],
"name": "simple-api-overview_get-path2-service_1",
"paths": [
"~/path2$"
],
"plugins": [],
"regex_priority": 200,
"strip_path": false,
"tags": [
"OAS3_import",
"OAS3file_27-routes-with-optional-headers.yaml"
]
},
{
"id": "27ea9a0a-216e-5c92-ae0b-8c9aa8493750",
"methods": [
"GET"
],
"name": "simple-api-overview_get-path2-service",
"paths": [
"~/path2$"
],
"plugins": [],
"regex_priority": 200,
"strip_path": false,
"tags": [
"OAS3_import",
"OAS3file_27-routes-with-optional-headers.yaml"
]
}
],
"tags": [
"OAS3_import",
"OAS3file_27-routes-with-optional-headers.yaml"
]
}
],
"upstreams": []
}
34 changes: 34 additions & 0 deletions openapi2kong/oas3_testfiles/27-routes-with-optional-headers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
openapi: "3.0.0"
info:
title: Simple API overview
version: v2
servers:
- url: https://server1.com/
paths:
/path2:
parameters:
- in: header
name: X-Path-Level-API-Version
required: true
schema:
type: string
enum:
- v1
- v2
get:
parameters:
- in: header
name: X-Method-Level-Int-Header
required: false
schema:
type: integer
enum:
- 1
- 2
- 3
operationId: get-path2-service
summary: List API versions Path2
responses:
"200":
description: |-
200 response
Loading
Loading