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.

Example Value content-type set as json in spring fox 2.8.0 version

See original GitHub issue
  • Version - springfox-swagger-ui v2.8.0 & springfox-swagger2 v2.8.0

  • Question -

I am using spring-fox (above version) in spring-boot 1.5. In swagger-ui.html I am seeing the Example Value is defaulted to application/xml however, I would like to select application/json as default while page loading. Is there anywhere it can be done via Docket configuration? Sample spring boot controller code and screenshot below.

@PostMapping(value = "/capture", produces = { "application/json", "application/xml" }, consumes = {
			"application/json", "application/xml" })
	ResponseEntity<?> capture(
			@ApiParam(value = "Capture request", required = true) @Valid 
			@RequestBody PaymentProcessorRequest paymentProcessorRequest) 

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
sujittripathycommented, Jul 25, 2018

Good to know @dilipkrish. Will raise a feature request Swagger-ui. Thanks

0reactions
wojciech-soltyscommented, Jul 31, 2019

I’ve created similar issue with PR but connected with Docket configuration: https://github.com/springfox/springfox/issues/3062

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring fox swagger ui version 2.8.0 Example Value
This Example Value is getting derived from the the Object Employee and converting to either xml , json etc. My question is, is...
Read more >
How to Set JSON Content Type In Spring MVC - Baeldung
Let's start with a simple example of an API exposing a JSON string. Here's our endpoint: @RequestMapping( value = "/greetings-with-response-body ...
Read more >
docs/release-notes.md · serv/springfox - Gitee.com
Content-Type not being set #1029; Support for custom Optional class #1027; java.io.FileNotFoundException: Jar URL cannot be resolved to absolute file path #1026 ...
Read more >
Versioning REST API with Spring Boot and Swagger
In this article, I'm going to show you how to maintain several versions of the REST API in your application in the most...
Read more >
Spring Boot RESTful API Documentation with Swagger 2
The current version defines a set HTML, JavaScript, and CSS assets to ... json-path. test. io.springfox. springfox-swagger-ui. 2.8.0.
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