Skip to content

fix: exclude overridable annotation values when parsing composed annotations#5179

Merged
ewaostrowska merged 2 commits into
swagger-api:masterfrom
Mattias-Sehlstedt:exclude-override-meta-annotations
Jul 21, 2026
Merged

fix: exclude overridable annotation values when parsing composed annotations#5179
ewaostrowska merged 2 commits into
swagger-api:masterfrom
Mattias-Sehlstedt:exclude-override-meta-annotations

Conversation

@Mattias-Sehlstedt

Copy link
Copy Markdown
Contributor

Pull Request

Thank you for contributing to swagger-core!

Please fill out the following information to help us review your PR efficiently.


Description

Change the meta-annotation parsing so that annotations that utilize @OverridesAttribute do not take the overridden annotation into consideration. This since the library currently does not support parsing the @OverridesAttribute value definition.

I know that the Hibernate validator most likely has code to manage this, but I do not believe that is a dependency that this project needs or wants as of now. Both swagger-core and springdoc-openapi both have extension possibilities for injecting interpretation logic of annotations, so that is how these annotations can be managed currently.

Fixes: #5178

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor (non-breaking change)
  • 🧪 Tests
  • 📝 Documentation
  • 🧹 Chore (build or tooling)

Checklist

  • I have added/updated tests as needed
  • I have added/updated documentation where applicable
  • The PR title is descriptive
  • The code builds and passes tests locally
  • I have linked related issues (if any)

Screenshots / Additional Context

@Mattias-Sehlstedt
Mattias-Sehlstedt force-pushed the exclude-override-meta-annotations branch from 91852e9 to ad6b598 Compare May 12, 2026 19:11
@ewaostrowska ewaostrowska added the backlog label May 14, 2026 — with Claude
@Mattias-Sehlstedt
Mattias-Sehlstedt force-pushed the exclude-override-meta-annotations branch 3 times, most recently from 7bb22f0 to c1b780f Compare June 24, 2026 22:15
@Mattias-Sehlstedt
Mattias-Sehlstedt force-pushed the exclude-override-meta-annotations branch from c1b780f to 30f1bc8 Compare June 28, 2026 13:15
@Mattias-Sehlstedt
Mattias-Sehlstedt force-pushed the exclude-override-meta-annotations branch 4 times, most recently from 9876aca to 38ef884 Compare July 8, 2026 18:09
@Mattias-Sehlstedt
Mattias-Sehlstedt force-pushed the exclude-override-meta-annotations branch 2 times, most recently from 047a776 to 566a40d Compare July 17, 2026 09:48
@Mattias-Sehlstedt
Mattias-Sehlstedt force-pushed the exclude-override-meta-annotations branch from 566a40d to 9ad9d89 Compare July 20, 2026 15:42
@ewaostrowska

Copy link
Copy Markdown
Contributor

Hi @Mattias-Sehlstedt!
Thank you for working on this issue :)
I agree that clearing the generated constraint data here is better than keeping values that may be wrong.

I also added implementation to cover repeatable @OverridesAttribute annotations. Adding full @OverridesAttribute should stay out of scope for now.

@ewaostrowska
ewaostrowska merged commit c4363f5 into swagger-api:master Jul 21, 2026
7 checks passed
@Mattias-Sehlstedt
Mattias-Sehlstedt deleted the exclude-override-meta-annotations branch July 21, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: OverridesAttribute meta annotation takes the default value

2 participants