swagger-api / swagger-api/swagger-codegen

Possible bug in code generation for java/springboot/ version 2.X

Open
#10,448 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

When generating a server stub for Spring/Springboot 2.X the file application.propseties defines the context path as server.contextPath. This is OK for springboot 1.X. However for 2.X it must be server.servlet.context-path.

Swagger-codegen version

codegen : 3.0.21

Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

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

Locate the Spring Boot server-stub template that emits application.properties and inspect how the context path is configured for Spring Boot 2.x. Generate a Java/Spring Boot 2.x server stub and verify that the emitted property uses server.servlet.context-path rather than server.contextPath.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.