springfox: 2.6.0 : Properties are not read anymore (regression)
- What version of the library are you using? 2.6.0
- Bug report.
- if you have a repo that demonstrates the issue for bonus points! https://github.com/cbornet/springfox-demos
Values from property file are not read when including @EnableSwagger2 I’ve added a /test endpoint in this commit to show the issue
curl "http://localhost:8081/springfox/test"
8080
Response should be 8081.
Downgrading to 2.5.0 solves the issue.
Probably linked to https://github.com/springfox/springfox/commit/e545b61e46513c131a009bf82ab2879ca4cc58d0
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 18 (12 by maintainers)
Commits related to this issue
- Added conditional PropertyPlaceholderConfigurer bean Not 100% happy with this solution as it means we no longer support spring 3.2.x fixes #1514 — committed to springfox/springfox by dilipkrish 8 years ago
- Added conditional PropertyPlaceholderConfigurer bean Verified that this solution also supports spring 3.2.x and up fixes #1514 — committed to springfox/springfox by dilipkrish 8 years ago
- Fixed the build related to #1514 — committed to springfox/springfox by dilipkrish 8 years ago
@jayanderson Within the next week
Ok, Good news. I traced down our issue and it seems that the current behaviour is fine, whereas up to version 2.5.0 Swagger was masking some errors we had in our code. We had some properties defined as such:
This placeholder has no default value, so it means the property is mandatory. Up to 2.5.0, I’m presuming Swagger was doing something and providing a default value for those properties. Using 2.6.X, Swagger does not provide a default value and SpringBoot complains, rightly so, that it cannot resolve ${defaults.whatever}.
So, in this case, it was a misconfiguration in our side that had been masked. Once we specified that the properties are optional with the colon at the end, everything worked.
Cheers!
@dilipkrish It works like a charm. Thanks for your quick answer ! I’ll upgrade to 2.6.1 as soon as it’s released.