2

Swagger 2.0 has support for reusable parameters, as described here.

How would i take advantage of this feature using Springfox

Is this feature supported in Springfox?

hendrix
  • 3,364
  • 8
  • 31
  • 46
  • In general reusable parameters are useful when designing spec-first. Since springfox is code-first approach, that is not really a thing. – Dilip Krishnan Apr 26 '18 at 11:36
  • I think reusable parameters are also useful in code-first approach. If you want your API properly documented, this feature would save you many lines of repetitive @ApiParam annotations (if you have many operations with many reused parameters) – hendrix Apr 26 '18 at 11:44
  • But based on your comment, i guess answer is NO, it is not supported :) – hendrix Apr 26 '18 at 11:49
  • A better technique for reuse in your case since you're in the spring ecosystems is [annotation aggregation/meta annotation](https://stackoverflow.com/questions/33345605/java-custom-annotation-aggregate-multiple-annotations) – Dilip Krishnan Apr 26 '18 at 12:08

1 Answers1

0

Based on comment from Dilip Krishnan, Springfox currently does not support this feature.

hendrix
  • 3,364
  • 8
  • 31
  • 46
  • That is a 100% true statement. However I will restate the fact that with springfox, you dont need to define `ApiParam` annotations on any parameter, unless you're trying to influence default behavior. It is one of [the goals](http://springfox.github.io/springfox/docs/current/#goals) of the project. – Dilip Krishnan Apr 26 '18 at 12:06