Skip to content

Bug: Fixes an issue with Annotated Generic properties getting applied to sibling properties#3259

Merged
bnasslahsen merged 1 commit intospringdoc:mainfrom
mcclellanmj:bug-parameterized-types
Apr 10, 2026
Merged

Bug: Fixes an issue with Annotated Generic properties getting applied to sibling properties#3259
bnasslahsen merged 1 commit intospringdoc:mainfrom
mcclellanmj:bug-parameterized-types

Conversation

@mcclellanmj
Copy link
Copy Markdown
Contributor

@mcclellanmj mcclellanmj commented Apr 10, 2026

This PR fixes an issue I found where having one property with a generic that has annotations would apply to the other properties within it. Included test cases which can be used as an example of how to reproduce the bug. Before this change the Pattern would show up on all 3 of the properties.

Before:

"parameters": [
          {
            "name": "firstNames",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "pattern": "^\\d+$",
                "type": "string"
              }
            }
          },
          {
            "name": "middleNames",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "pattern": "^\\d+$",
                "type": "string"
              }
            }
          },
          {
            "name": "phoneNumbers",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "pattern": "^\\d+$",
                "type": "string"
              }
            }
          }
        ]

After:

"parameters": [
          {
            "name": "firstNames",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "middleNames",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "phoneNumbers",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "pattern": "^\\d+$",
                "type": "string"
              }
            }
          }
        ]

@bnasslahsen bnasslahsen merged commit 0b0ebab into springdoc:main Apr 10, 2026
bnasslahsen added a commit that referenced this pull request Apr 10, 2026
Bug: Fixes an issue with Annotated Generic properties getting applied to sibling properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants