swagger-api / swagger-api/swagger-codegen

[SPRING] [MAVEN] All the methods are always PUT

Open
#8,354 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 you use the maven generator for generate the code, all the methods of the endpoints shows allways as PUT

Swagger-codegen version

2.3.1

Swagger declaration file content or url

Any endpoint, as aGET, will work.

Command line used for generation
false io.swagger swagger-codegen-maven-plugin ${version.swagger.codegen} ${project.basedir}/src/main/resources/${swagger.intermediary.file} ${server.intermediary.name} generate-sources generate spring ${server.intermediary.folder}
								<modelPackage>${server.intermediary.package}.model</modelPackage>
								<apiPackage>${server.intermediary.package}.api</apiPackage>
								<invokerPackage>${server.intermediary.package}</invokerPackage>
								<modelNameSuffix>Json</modelNameSuffix>

								<groupId>${project.groupId}</groupId>
								<artifactId>${server.intermediary.name}</artifactId>
								<artifactVersion>${project.version}</artifactVersion>

								<configOptions>
									<sourceFolder>src/main/java</sourceFolder>
									<title>${server.intermediary.name}</title>
									<basePackage>${server.intermediary.package}</basePackage>
									<configPackage>${server.intermediary.package}.configuration</configPackage>

									<useOptional>true</useOptional>
									<java8>true</java8>
									<dateLibrary>java8</dateLibrary>

									<artifactDescription>Servidor intermediador</artifactDescription>
								</configOptions>
							</configuration>
						</execution>
					</executions>
				</plugin>
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

Start by reproducing the report with the Spring generator and the provided Maven plugin configuration, using a minimal endpoint whose declared method is GET. Then inspect the Spring generator templates or entry points that emit endpoint mappings and compare the generated methods with the declaration; done means each generated endpoint preserves its declared HTTP method.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.