Jackson is ignoring spring.jackson.property-naming-strategy=SNAKE_CASE. I am using springBootVersion 1.4.2.RELEASE. In my application.properties file, I have added spring.jackson.property-naming-strategy=SNAKE_CASE But Jackson is not honoring this property, and my REST response is still camelCase. Interestingly, this annotation works just fine @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) With this annotation, I am getting snake_case response. But I don’t want to annotate each response class, it’s a bit annoying. Edit
Tag: spring-boot
Optional pagination with Spring
I am pretty new to java and spring. What I want to implement is api endpoint /tickets with pagination and sorting. I made it and it works. But also what I would like to do is to return plain list of all tickets if size and page are not specified in the query params, so in FE I can use
Consider defining a bean of type ‘package’ in your configuration [Spring-Boot]
I am getting the following error: I have never seen this error before but it’s odd that the @Autowire is not working. Here is the project structure: Applicant Interface ApplicantImpl Now I should be able to just Autowire Applicant and be able to access, however in this case it is not working when I call it in my @RestController: ————————UPDATE
Logback conversion rule parametrizing
Is there any way of parametrizing conversion rule in Logback? I’ve tried adding child nodes, additional attributes and I don’t see a way to do it. I would like to add parameter that will be used by LongMessageConverter class. My application is setup on Spring Boot and I am using Sl4J. Answer This is more a question around Logback than
Why does MockMvc always return empty content()?
I’m trying to test my rest api with mockMvc. The test failed because of: From the output of print(), I can know the API actually returned the expected string “iPhone”. And I guess the empty “Actual” above is caused by empty “Body” below My questions are: Why MockHttpServletResponse’s Body is empty; How can I correctly test the response of API.
Spring boot and Thymeleaf – Hot swap templates and resources once again
I tried all tips and tricks that I found here and in docs, but still no luck. I have Spring webapp with Thymeleaf. Resources and templates are not reloaded when I call update in IDEA (it says nothing to reload). I can then press ctrl+f5 in a browser like crazy, changes are just not there. Everything is configured in one
Authentication issue with repo accessed from Spring Cloud Config Server hosted on GitHub
I’m hosting a configuration in a repo on GitHub. If I keep the repo public all’s good, but if I make it private I face: the property I use to target the repo is What should I do to configure this properly with the private repo, thanks Answer you need to add the and things should workout for you
Spring-boot default profile for integration tests
Spring-boot utilizes Spring profiles which allows to have separate config for different environments. One way I use this feature is to configure the test database to be used by integration tests. I wonder, however: is it necessary to create my own profile ‘test’ and explicitly activate this profile in each test file? Right now, I do it in the following
Why do I always get Whitelabel Error Page with status “404” while running a simple Spring Boot Application
My Controller My JSP (welcome.jsp) inside /WEB-INF/jsp (parent folder is WebContent) My pom.xml My App Initializer I even added thymeleaf dependency to my pom. It still didn’t work. When ever I hit localhost:8080/hello or /indexPage or /indexPageWithModel it always says Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Wed
Generate Unit Test Code from Swagger API for Java REST
I was trying using Swagger test templates and found this an interesting tool to generate the test files for my controllers, but It seems to just work for NodeJs projects, because there is not a similar tool for the Java platform. Do somebody knows about how to generate these Test files from my controllers by using a swagger file for