OpenAPITools / OpenAPITools/openapi-generator
[BUG][java-helidon-server] If a service only contains a single endpoint, the routing is wrong
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When generating a service with only a single endpoint, the "/" path pattern is used. Actual output:
@Override
public void routing(HttpRules rules) {
rules.get("/", this::filedownload);
}
However this means that the actual endpoint is not found, and even if it were, the path parameter can not be extracted.
Expected output would be.
@Override
public void routing(HttpRules rules) {
rules.get("/bugs/filedownload/{fileName}", this::filedownload);
}
openapi-generator version
7.8.0 gradle plugin
OpenAPI declaration file content or url
Generation Details
openApiGenerate {
generatorName.set("java-helidon-server")
inputSpecRootDirectory.set("$rootDir/specs/")
outputDir.set("$rootDir/src")
apiPackage.set("my.package.api")
modelPackage.set("my.package.model")
invokerPackage.set("my.package.api.services")
validateSpec.set(true)
generateApiTests.set(false)
configOptions.set([
apiPackage : "my.package.services",
modelPackage : "my.package.model",
invokerPackage : "my.package.services",
dateLibrary : "java8",
gradleProject : "true",
groupId : "my.package",
artifactId : "example",
library : "se",
helidonVersion : "$helidonVersion",
serializationLibrary: "jackson",
fullProject : "false",
useAbstractClass : "true",
"x-helidon-groupBy" : "first-path-segment"
])
}
Steps to reproduce
Use the java-helidon-server plugin to generate the server implementation
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the bugs.json OpenAPI declaration and reproduce generation using the java-helidon-server plugin configuration from the report. Inspect the generated routing for a service with one endpoint; done means it uses the endpoint path "/bugs/filedownload/{fileName}" instead of "/" and preserves path-parameter extraction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100