Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container element constraints not recognized in generated openapi.json #4224

Closed
varinderkaur61 opened this issue Jul 22, 2022 · 1 comment
Closed

Comments

@varinderkaur61
Copy link

varinderkaur61 commented Jul 22, 2022

With hibernate 6.x+ versions, we have the support for container element constraints i.e.
List<@Pattern(regexp="<sample pattern>") String> listElement;

This is to validate each item under the list with the regex provided inside diamond operator. It do validates fine but the open api.json doesn't recognize this annotation and in resulting open api specs, it doesn't show any pattern or validation for individual items.

Expectation is it should show the applied pattern under items of list/array i.e.:

The generated open api.json for the above schema object:

"components": {
        "schemas": {
            "listElement": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            }
        }
  }

The expected/required open api specs:

"components": {
        "schemas": {
            "listElement": {
                "type": "array",
                "items": {
                    "type": "string",
                     "pattern": "<sample pattern>"
                }
            }
        }
  }
@frantuma
Copy link
Member

frantuma commented Mar 6, 2023

fixed by #4373

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

No branches or pull requests

2 participants