Kong / Kong/go-apiops

Increase or allow configuration of the 32-character limit for path-parameter names

Open
#293 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
27
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Description
Currently, openapi-2-kong enforces a strict 32-character limit on sanitized path parameters. When a transformation exceeds this limit, the process fails with:
path-parameter name exceeds 32 characters: '...' (sanitized to '...')

In many enterprise OpenAPI specifications, parameter names are often descriptive (e.g., organization_subscription_identifier) or generated from models that naturally exceed 32 characters. This forces manual renaming of parameters, which breaks the "source of truth" workflow of the OpenAPI document.

Relevant Code
The constraint is currently hardcoded in the SanitizeRegexCapture logic:

```
captureName := openapitools.SanitizeRegexCapture(varName, opts.InsoCompat)
if len(captureName) >= 32 {
return nil, fmt.Errorf("path-parameter name exceeds 32 characters: '%s' (sanitized to '%s')",
varName, captureName)
}
```
Proposed Solution
I would like to propose one of the following:

Increase the hard limit: Raise the limit to 64 or 128 characters to accommodate modern naming conventions.

Make it configurable: Add a CLI flag or option (e.g., --max-parameter-length) to allow users to override this limit at their own risk.

Thanks

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the SanitizeRegexCapture logic shown in the issue and trace how its options and CLI configuration are passed through openapi-2-kong. Decide whether the intended scope is a higher fixed limit or a configurable one, then verify the chosen behavior for descriptive path-parameter names and the existing over-limit error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, openapi
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.