springfox / springfox-javadoc

Ability to use Javadoc for documentation for generating OpenAPI specifications
Apache License 2.0
17 stars 15 forks source link

Corrupted Properties file generated for multivalued Request Mapping #7

Open gazirahman opened 6 years ago

gazirahman commented 6 years ago

If there is a request mapping as below: @RequestMapping(value={"/path1", "path2"}) Then in the generaeted properties file entries of this is found as below: /{"/path1",\ "/path2"}.POST.param.operationType= As a result the swagger api can't find the request mapping in the properties file as it searches for entries like: /path1.POST.param.operationType. The fix should be to generate multiple entries in the properties file like: /path1.POST.param.operationType /path2.POST.param.operationType for each of the values of maultivalued request mapping.

neumaennl commented 6 years ago

Oof, this is a big one. The code in the doclet currently only expects one value/path. I also noticed that the method param will be ignored if you specify multiple methods, because the code only expects one method as well. This means the whole doclet has to be rewritten with support for multiple paths and methods. It can no longer use one StringBuilder per Annotation and simply use AnnotationValue.toString(). The code has to check if AnnotationValue.value() is an array of AnnotationValue objects and then produce multiple entries in the properties file. This will probably be a big rewrite and take some time.