Skip to content

Add support for parameters with dashes when importing an OpenAPI specification #2012

@255kb

Description

@255kb

Problem to solve

Parameters with dashes are not properly translated to route parameters due to a too restrictive regex:

Example:

paths:
  /{path-parameter}:

Does not get translated to /:pathParameter.

Proposed solution

Correctly convert dashed params to a route param.
⚠️ Express will interpret dashes literally, which means this cannot work: /:path-parameter and expect the URL to be called like this: /1234-parameter. So, the parameter needs to be translated to /:pathParameter instead.

Metadata

Metadata

Assignees

Labels

component:lib-commonsIssue related to the @mockoon/commons libeffort:easyQuick fixes or small taskspriority:lowNice-to-have features or minor issuesstatus:approvedIssue confirmed for implementation

Projects

Status

📦 Released (v9.5.0)

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions