swagger-api / swagger-api/swagger-codegen

mustache file for swagger ui configuration uses deprecated class/methods

Open
#8,318 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 I use spring 5 and use swagger-codegen/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-mvc/swaggerUiConfiguration.mustache
as a template the generated class contains deprecated code.
Also if the json that is created by the API contains new lines etc, the pretty printer that is attached in this configuration might produce bad results (escaped quotes and new lines will appear when using curl/postman).
I think that the example should be up to date or at least you should have one that is compativle with spring 5.

This example is still not updated in head's version.

we are using swagger codegen 2.3.1 with spring 5.0.3.
When using the template (codegen/src/main/resources/JavaSpring/libraries/spring-mvc/swaggerUiConfiguration.mustache) almost as is, returning an already formatted json will produce results which include \r\n and escaped quotes (") as part of the result.

updaing the code to match the new interface in spring 5 and not setting the default mapper caused the json to return as expected via curl/postman.

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 with swagger-codegen/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-mvc/swaggerUiConfiguration.mustache and compare its configuration with the Spring 5 interface. Check the generated class using an already formatted JSON response through curl or Postman. Done means deprecated code is updated and formatted JSON no longer includes escaped quotes or line breaks.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.