Skip to content

Defining grouping in swagger - #4246

Closed
S66D wants to merge 7 commits into
swagger-api:masterfrom
S66D:master
Closed

S66D wants to merge 7 commits into
swagger-api:masterfrom
S66D:master

Conversation

@S66D

@S66D S66D commented Sep 5, 2022

Copy link
Copy Markdown

Defining grouping in swagger endpoints to reduce the challenges brought in creating a per class request models in huge system for better maintainability and for less class redundancy.

@S66D

S66D commented Sep 5, 2022 •

Copy link
Copy Markdown
Author

This change will support many open and unanswered issues

springdoc/springdoc-openapi#510
springdoc/springdoc-openapi#1374
springdoc/springdoc-openapi#1568
https://stackoverflow.com/questions/71921999/java-annotation-based-validation-io-swagger-v3-oas-annotations-media-schema
https://stackoverflow.com/questions/44506965/jax-rs-group-validation-not-recognized-by-swagger-jax-rs-version-1-5-12
https://stackoverflow.com/questions/61461679/how-to-apply-constraints-with-javax-validation-constraints-groups-from-swagger-w
https://stackoverflow.com/questions/59477719/swagger-spring-boot-how-to-set-the-example-value-to-be-passed-in-the-api-base
https://community.smartbear.com/t5/Swagger-Open-Source-Tools/Support-validation-groups-when-reading-Java-annotations/td-p/199556
https://community.smartbear.com/t5/Swagger-Open-Source-Tools/Grouping-Schemas/m-p/201738
https://community.smartbear.com/t5/Swagger-Open-Source-Tools/How-to-generate-docs-for-api-under-particular-group/m-p/197721

@S66D S66D changed the title Defining endpoints grouping in swagger Defining grouping in swagger Sep 5, 2022
@didjoman

Copy link
Copy Markdown

That Pull-Request would be SO helpful as it fixes a major bug (and thus lot of issues).
I was so happy when I saw it, and I am watching it for 4months now, but sadly it never gets approved :(
How could we fasten the approval of the PR :) ?

@mdaumen

mdaumen commented Jan 26, 2023

Copy link
Copy Markdown

I'm waiting on this too - it's maddening. I have a model class like this:

  @Schema(description = "Unique ksuid for this Event - returned on submission.", required = false)
  @NotEmpty(groups = {EventConsumerValidations.class})
  @Builder.Default
  private Optional<String> id = Optional.empty();

The idea is we want the validation after the object has been created with an id and not to have a client pass one in. I've tried required = false, I've tried a distinct @Schema annotation on the controller method that specifically omits that id field from the requiredProperties attribute. It's a huge omission. What is the hold-up with this PR?

@virgilsb

Copy link
Copy Markdown

I'm also looking forward to this.

@b-smets

b-smets commented May 8, 2023

Copy link
Copy Markdown

Any updates on this PR? Is there something I can assist with to get this merged?

@kangaroo1122

Copy link
Copy Markdown

Any updates?

@CatarinaRibas

Copy link
Copy Markdown

Do you have any updates on this?
Can I help with something in order to merge this? We really need this functionality.

Thank you in advance

@Mitic96

Mitic96 commented Feb 1, 2024

Copy link
Copy Markdown

Any updates?

This is a crucial functionality that would help many of us.
If there is anything that needs to be done before merging this PR, I propose for Maintainers to write the additional requirements.

@lisi9988

lisi9988 commented Jul 1, 2024 •

Copy link
Copy Markdown

I also find this very useful as it reduces unnecessary explanations. This is an example I created based on version 1.7.0 and using another project that beautifies the page. I hope the native project will support this feature soon.
knife4j-group, knife4j

@BBeeker-BAnz

BBeeker-BAnz commented Aug 5, 2024 •

Copy link
Copy Markdown

Any updates for this?
Here is a solution for a problem sitting for 2 years, why is this still an issue?

@mathiewz

Copy link
Copy Markdown

Any updates ?
How does this PR still require review since 2022 ? There are discussions about this exact topic since at least 2020... 😐

@Milena92

Copy link
Copy Markdown

Any updates ? How does this PR still require review since 2022 ? There are discussions about this exact topic since at least 2020... 😐

Indeed.... It's really necessary feature.... Workarounds are painful really for this...

@Gianpiero-Errigo

Copy link
Copy Markdown

Could we just know if this merge is being considered or is going to be closed, please?

@frantuma

frantuma commented May 8, 2025

Copy link
Copy Markdown
Contributor

Groups support has been added in #4853

@frantuma frantuma closed this May 8, 2025
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.