Skip to content

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

@kuntal1461

Description

@kuntal1461

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions