question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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. jsonlint … 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:closed
  • Created 7 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
RobWincommented, Nov 1, 2016

As far as I remember Swagger2Markup supports Maps since this PR: https://github.com/Swagger2Markup/swagger2markup/pull/121/

0reactions
RobWincommented, Nov 1, 2016

@nikit-cpp Btw. If you like and use Springfox and Swagger2Markup, we would love to get your GitHub stars 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found