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.

@ExampleProperty/value is getting ignored

See original GitHub issue

What version of the library are you using?

2.9.2

What kind of issue is this?

Bug

Example Repository

https://github.com/napolev/springfox-swagger2-issue

How to recreate the issue

$ git clone https://github.com/napolev/springfox-swagger2-issue
$ cd springfox-swagger2-issue
$ gradle bootRun

Description of the issue

On the repository pointed above there is a very simple project which contains the following file:

/src/main/java/com/example/demo/car/CarController.java

Preview

The issue is that the @ExampleProperty / value is getting ignored as you can see on the image below:

Preview

Other than that, everything works fine. For example, for the following payload the response is correct:

Preview

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:13
  • Comments:24 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
shantiscommented, Dec 18, 2019

@dilipkrish Any update on this issue? The examples are not working in 2.9.2. For us examples are a must for documentation. Please help!

3reactions
napolevcommented, Apr 3, 2020

Bingo! Finally on this commit I was able to find the way to make Sprinfox Swagger to auto populate the values on the Swagger UI:

https://github.com/napolev/springfox-swagger2-issue/commit/7e2591d07fc5d8e83282f01bd7e8ce5e2475c761

Here you have a screenshot of it:

image

Thank you guys for all your help including @indicasta.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Model's Ignored property does not seem to get set using init ...
I am facing an issue where I am unable to set an ignored property through init(value: Any) . The way I understood ignored...
Read more >
Code Inspection: Member initialized value ignored - JetBrains
For example, if there are more than one constructor, it enables you to initialize a field with different values.
Read more >
Class property types are ignored when passed as an ... - GitHub
Expected behavior: Class property types would be respected when assigning their values whether passed as an object or assigned individually. I'm ...
Read more >
Jackson Ignore Properties on Marshalling - Baeldung
This tutorial will show how to ignore certain fields when serializing an object to JSON using Jackson 2.x.
Read more >
How to ignore properties with System.Text.Json | Microsoft Learn
To ignore individual properties, use the [JsonIgnore] attribute. The following example shows a type to serialize. It also shows the JSON ...
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