Skip to content

Support headers in openapi2kong #1702

@mheap

Description

@mheap

User is looking to have deck openapi2kong to handle header parameters within OAS file and convert them into different routes per header filter configured.

  "paths": {
    "/documentID/{documentID}": {
      "get": {
        "tags": [
          "HandlingDocument"
        ],
        "summary": "Handler for the GET request",
        "parameters": [
          {
            "name": "docymentName",
            "in": "path",
            "description": "name ID",
            "required": true,
            "schema": {
              "type": "string",
              "description": "name ID",
              "nullable": true
            }
          },
          {
            "name": "documentID",
            "in": "path",
            "description": "Document",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Document",
              "format": "int32"
            }
          },
          {
            "name": "X-Some-Version",
            "in": "header",
            "description": "API Version",
            "schema": {
              "type": "String",
              "default": "1.0"
            }
          }
        ],

In the above spec, parameters section customer have added X-Some-Version , so it should be converted to header by deck openapi2kong without using x-kong-route-defaults
https://github.com/Kong/go-apiops/blob/main/docs/learnservice_oas.yaml#L108

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions