spec violation: springfox generates json without parameter type for @RequestParam Map<String, String>
See original GitHub issue- What version of the library are you using? Is it the latest version?
2.6.0
- What kind of issue is this?
Bug report.
I start from example from here. If my businness method is something like
fail(@RequestParam Map<String, String> requestParameters)
then Swagger2Markup (component of both swagger2markup gradle or maven plugin) fails on Assertion, see stacktrace here.
Here is validation in Swagger2Markup which fails.
I investigates it and in OpenApi specification said that:
If in is any value other than “body”: … field ‘type’ requiered
I get swagger’s json (from test below) and prettify it via jsonlint, and in it json has no ‘type’ parameter.
… but ‘items’ are present, may be it’s attempt to generate array?
I wrote some test for it based on boot-static-docs, which check existence of ‘type’ parameter, if need I can write full example project with swagger2markup gradle plugin.
Here is test
Here is controller
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Cannot use Map as a JSON @RequestParam in Spring REST ...
Here is the solution that worked: Just define a custom converter from String to Map as a @Component . Then it will be...
Read more >docs/release-notes.md · serv/springfox - Gitee.com
... (#1555) Dead circulation @evencht; (#1554) spec violation: springfox generates json without parameter type for @RequestParam Map<String, String> wontfix ...
Read more >Springfox Reference Documentation - GitHub Pages
Allows globally configuration of default path-/request-/headerparameters which are common for every rest operation of the api, but aren`t needed ...
Read more >Swagger-2 API documentation for Spring App using Springfox
In this tutorial, we'll explore the Springfox Java libraries to generate Swagger based API specifications for the Spring application.
Read more >Issues with Swagger-codegen for C# - Google Groups
The RestSharp.dll generated does not have RestClient. ... Although C# has char as a primitive data type, char in java gets converted to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As far as I remember Swagger2Markup supports Maps since this PR: https://github.com/Swagger2Markup/swagger2markup/pull/121/
@nikit-cpp Btw. If you like and use Springfox and Swagger2Markup, we would love to get your GitHub stars 😃