swagger-api / swagger-api/swagger-codegen

[JAVA] - Consider regex for path params (subresource operation)

Open
#6,263 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Java Enhancement: Feature help wanted
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I'm trying to generate resource endpoints which contain some sort of regex to validate the path params. Fox example: @Path(/resource/{res:[a-zA-z]})

Couldn't find a way to produce that kind of souce code. Does anyone know if this feature is already implemented?

Swagger-codegen version

2.2.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the Java server generator turns OpenAPI path parameters into @Path declarations and identify the relevant templates or entry points. Confirm whether regex constraints are represented in the input specification and determine the generated syntax needed for a constrained path parameter. Done means Java output preserves the requested regex in the generated resource endpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.