swagger-api / swagger-api/swagger-codegen-generators

Spring server generated from yaml does not compile

Open
#359 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

Q&A (please complete the following information)
  • OS: [win10 pro 64 bit]
  • Browser: [chrome]
  • Version: [72.0.3626.121]
  • Method of installation: [on line]
  • Swagger-Editor version: [https://editor.swagger.io]
  • Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0.1]
Content & configuration

Example Swagger/OpenAPI definition:

https://berlingroup.stackstorage.com/s/iVgP0TIgErYRpCi
Describe the bug you're encountering
To reproduce...

Steps to reproduce the behavior:

  1. Go to https://berlingroup.stackstorage.com/s/iVgP0TIgErYRpCi
  2. Download PSD2 yaml api
  3. Import api into: https://editor.swagger.io
  4. Generate Server -> spring
  5. Generated project does not compile
Expected behavior

Generated project should compile to be deployable

Additional context or thoughts

Problem seem to be incorrectly interpreted multiline comments, and quotation marks (") used in values, which are also java string denotation marks.

i.e.:

allowableValues = ""payments", "bulk-payments", "periodic-payments""

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 the linked PSD2 YAML, import it into https://editor.swagger.io, and use Generate Server → spring to reproduce the failure. Inspect the generated code around multiline comments and quoted allowableValues, then confirm the generated project compiles successfully; no source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, yaml
Domain
backend, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.