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

Add support validation annotations extensions. #1789

Merged

Conversation

altro3
Copy link
Collaborator

@altro3 altro3 commented Sep 26, 2024

Add processing custom messages to jakarta validation annotations with extensions:
x-pattern-message
x-size-message
x-not-null-message
x-min-message
x-max-message

@altro3 altro3 force-pushed the fixes-for-extensions-and-templates branch 2 times, most recently from d661d9c to a10a871 Compare September 26, 2024 15:51
Copy link
Contributor

@sdelamo sdelamo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are are these extensions documented anywhere x-pattern-message, x-size-message, x-not-null-message, x-min-message, x-max-message ? Is this something we are inventing for Micronaut OpenAPI or is it coming from a specification?

@sdelamo sdelamo changed the base branch from 6.12.x to 6.13.x September 30, 2024 13:24
@sdelamo
Copy link
Contributor

sdelamo commented Sep 30, 2024

can you merge 6.13.x ?

@altro3
Copy link
Collaborator Author

altro3 commented Sep 30, 2024

This satisfies the specification because these are extensions.

The openapiGenerator core does not support these extensions, but for example x-pattern-message is supported by the spring generator: https://openapi-generator.tech/docs/generators/spring/

{E722B03A-BEF8-4070-8B4B-684781984953}

We are not obliged to support certain extensions, but we also have the right to create new extensions.

I added the rest of the extensions in connection with this PR: OpenAPITools/openapi-generator#19630

In general, all these extensions are needed exclusively for more correct code generation. Support for new extensions does not affect the work of current users in any way, it simply adds the ability for them to describe the openapi specification so that the generated code is more accurate

@altro3 altro3 force-pushed the fixes-for-extensions-and-templates branch 2 times, most recently from 2ec555c to f778e97 Compare October 3, 2024 06:44
@graemerocher graemerocher requested a review from sdelamo October 3, 2024 08:55
Copy link
Contributor

@sdelamo sdelamo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these extensions defined or explained in our documentation? If not can you document, what we support?

@altro3
Copy link
Collaborator Author

altro3 commented Oct 4, 2024

Unfortunately, I don't have time to write full documentation yet. You see, at the moment we don't have any documentation for the generator at ALL. Therefore, we need to write it not only about these extensions, but about the entire generator as a whole.

Therefore, I suggest not to bother with describing the generator features for now. I mean, specifically in these PRs, but in the future it will be time to write documentation for the generator. I was going to do this, but I haven't found the time yet

@graemerocher
Copy link
Contributor

Please resolve the conflicts

@altro3 altro3 force-pushed the fixes-for-extensions-and-templates branch 2 times, most recently from 8dffba7 to 5022b81 Compare October 10, 2024 08:27
@altro3 altro3 force-pushed the fixes-for-extensions-and-templates branch from 5022b81 to ec0feaa Compare October 10, 2024 08:29
@graemerocher graemerocher requested a review from sdelamo October 10, 2024 08:45
@altro3 altro3 merged commit d26710d into micronaut-projects:6.13.x Oct 10, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants