Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcard annotations in @PATH dropped in swagger #4412

Closed
harveycggit opened this issue May 16, 2023 · 1 comment
Closed

Wildcard annotations in @PATH dropped in swagger #4412

harveycggit opened this issue May 16, 2023 · 1 comment

Comments

@harveycggit
Copy link

When I use the plugin swagger-maven-plugin-jakarta to create swagger from my java annotations, any wildcards in @path annotations are dropped. For instance:

@path("/sws/{var:.*}")
@get
@produces(MediaType.TEXT_XML)

results in:

/v1/sws/{var}:
get:
description: Proxy banner SOAP GET
operationId: serveGet
etc

Which means that I get a 404 when calling a path such as https://myserver.com/api/v1/sws/housing/studentAccountService.xml

Note that jakarta has no problem handling this; when I hit the application on my desktop it works just fine, but because I am generating swagger dynamically to populate my 3scale gateway, 3scale does not understand that it is a wildcard path because swagger-maven-plugin-jakarta has removed the wildcard.

Is there any way to retain the wildcards when the swagger is generated?

@frantuma
Copy link
Member

OpenAPI specification only allows path templating and Swagger Core drops the regex part accordingly, as it would be not valid.

#4415 introduces a slightly better support by adding pattern to path parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants