You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We currently use GroupedOpenApi to define several grouped api.
We have been mostly creating package to identify each group. But we have a lot of api's that are shared between the packages. So we end up doing abstract classes and then extend them in the package so that the common code is shared.
This works however as we get more and more packages, it is getting more difficult to manage the differences.
Describe the solution you'd like
There are currently many option to identifying the api's to be included in the group such as packageToScan, pathToInclude, ....
I would like to propose a new one that is based on the java annotations.
i.e. annotationsToMatch()
It could include the list of java annotation to match which could be used to identify the api's to be included in the group specificaion.
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface App1Annotation {
}
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface App2Annotation {
}
In this example app1 would have both apis
But app2 would only have the /app1andapp2api api.
Describe alternatives you've considered
It may be possible using other method like the packageToScan and pathToInclude but it seems like this creates messy code. Using annotations seems to be cleaner option.
Additional context
To be consistent with other functions,
annotationsToMatch() should probably accept a list of annotations in case there are multiple.
annotationsToMatch() could be applied to annotations on classes (to include the full class) or on methods (to be specific to one method).
There should probably be an annotationsToExclude() to also be consistent with existing methods.
If we don't want to use third party reflections class to scan all annotations then the method may need a base class for package to scan for the annotations so method may be something like this, annotationsToMatch(List<String> packageNames, Class<? extends Annotation>... annotations);
Or annotationsToMatch(List<String> packageNames, List<Class<? extends Annotation>> annotations)
Or packagesToScan(String... packagesToScan).annotationsToMatch(Class<? extends Annotation>... annotations)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
We currently use GroupedOpenApi to define several grouped api.
We have been mostly creating package to identify each group. But we have a lot of api's that are shared between the packages. So we end up doing abstract classes and then extend them in the package so that the common code is shared.
This works however as we get more and more packages, it is getting more difficult to manage the differences.
Describe the solution you'd like
There are currently many option to identifying the api's to be included in the group such as packageToScan, pathToInclude, ....
I would like to propose a new one that is based on the java annotations.
i.e.
annotationsToMatch()
It could include the list of java annotation to match which could be used to identify the api's to be included in the group specificaion.
In this example app1 would have both apis
But app2 would only have the
/app1andapp2api
api.Describe alternatives you've considered
It may be possible using other method like the packageToScan and pathToInclude but it seems like this creates messy code. Using annotations seems to be cleaner option.
Additional context
To be consistent with other functions,
annotationsToMatch()
should probably accept a list of annotations in case there are multiple.annotationsToMatch()
could be applied to annotations on classes (to include the full class) or on methods (to be specific to one method).annotationsToExclude()
to also be consistent with existing methods.annotationsToMatch(List<String> packageNames, Class<? extends Annotation>... annotations);
Or
annotationsToMatch(List<String> packageNames, List<Class<? extends Annotation>> annotations)
Or
packagesToScan(String... packagesToScan).annotationsToMatch(Class<? extends Annotation>... annotations)
The text was updated successfully, but these errors were encountered: