swagger-api / swagger-api/swagger-core

[Feature]: Reduce Boilerplate in swagger-core Models (Optional Lombok Support or Alternatives)

Open
#4,976 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog Feature
Dominant language
Java
Stars
7.5k
Forks
2.3k
Avg merge
18h 1m
Merged PRs (30d)
10

Description

Feature Description
Swagger-core currently contains a significant amount of boilerplate code (getters, setters, equals, hashCode, toString) in its model and utility classes.
This feature request proposes introducing a mechanism to reduce boilerplate and improve maintainability. One option is exploring Project Lombok (scoped as provided), or alternatively considering other strategies such as code generation or templates.
The aim is not to change runtime behavior but to make the codebase easier for contributors to maintain, and reduce the chance of inconsistencies in manually written methods.

Use Case
Contributors: Adding new fields or modifying model classes would be less error-prone and require fewer lines of repetitive code.
Maintainers: Smaller diffs in PRs, fewer manual methods to review, and easier long-term maintenance.
Community: New contributors onboarding into swagger-core would spend less time on boilerplate and more on logic/bug fixes.

✅ Benefits
Reduced boilerplate → smaller diffs, easier reviews.
Less risk of manual mistakes in equals/hashCode.
Faster iteration for contributors.

❓ Questions for maintainers
Would the project be open to Lombok in any capacity (even if limited)?
If not Lombok, would you consider other boilerplate-reduction strategies?
Should we explicitly document the “no Lombok” stance in the contribution guide to avoid confusion for new contributors?

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 reviewing the swagger-core model and utility classes that contain the repeated getters, setters, equals, hashCode, and toString methods, then check the contribution guide. Compare the proposed Lombok approach with code generation or templates and document a chosen strategy, including its build and maintenance implications.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.