Skip to content

[Bug]: OverridesAttribute meta annotation takes the default value #5178

@Mattias-Sehlstedt

Description

@Mattias-Sehlstedt

Description of the problem/issue

Tied to the behavior introduced in #4986 and discussed in #4986 (comment). The behavior is also documented in a test introduced with the PR.

I am currently using my own injected behavior for Hibernates @Range, and this new behavior will affect that since it will parse the default values present on the @Range annotation.

I would suggest that the application's behavior would be to omit any overridable value, to ensure that no incorrect default value gets forwarded to the specification.

Both swagger-core and springdoc-openapi have great extension possibilities to inject processing of these types of composed/meta annotations. E.g., as per this example in springdoc.

Affected Version

2.2.50

Earliest version the bug appears in (if known):
2.2.50

Steps to Reproduce

See test.

Expected Behavior

Actual Behavior

The @Min and @Max and excluded since we do not read the configured values.

The @Min and @Max are parsed, as per the shared test.

Logs / Stack Traces

Additional Context

Checklist

  • I have searched the existing issues and this is not a duplicate.
  • I have provided sufficient information for maintainers to reproduce the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions