The openapi2kong command generates duplicate plugin IDs when a Content-Type header parameter is defined as an enum with multiple
values in an OpenAPI 3.0 specification. This results in invalid Kong configuration that fails validation with the error:
entity already exists.
Oas file:
openapi: 3.0.3
info:
version: v1
title: Example API
paths:
/api/v1/example:
post:
operationId: exampleOperation
x-kong-plugin-rate-limiting-advanced:
enabled: true
config:
limit: [500]
parameters:
- name: Content-Type
in: header
required: true
schema:
type: string
enum:
- application/xml
- text/xml
Generate Kong configuration:
deck file openapi2kong --spec ./oas.yaml --output-file deck.yaml
Validate the generated configuration:
deck file validate deck.yaml
oas-minimal.yaml
deck.yaml