Skip to content
Advertisement

Tag: spring-rest

spring rest @RequestBody does not validate with @Valid

I’m learning java and spring boot and I am trying to validate a controller parameter which was bound from json. I’ve got simple Entity: Which I want to persist through the following controller: My understanding is that the resource argument should be valid when entering the method. But posting an empty uri field does not trigger the validation of the

Multiple ‘as-value’ properties defined

I want to create a ENUM which holds different statuses for possible database values and use them also to generate possible drop down statuses in FE: Full code: https://github.com/rcbandit111/Search_specification_POC/blob/main/src/main/java/org/merchant/database/service/businesscustomers/BusinessCustomersStatus.java But when I make a POST request to add a new record I get this error: Note that I have changed TicketStatus with BusinessCustomersStatus into the error stack. When I make

Rest API ResponseEntity add extra attribute to response

I’m trying to figure out response of a GET method API, it is returning extra attribute with name “attributesMap” Reponse entity return code is return ResponseEntity.ok(document); document model class but the API reponse JSON as an extra attribute “attributesMap”. Sample JSON as below: { “id”: “xxx”, “format”: “xx”, “attributes”: [ { “name”: “attr1”, “values”: [ “val1” ] } ], “type”:

Spring Boot REST API using LDAP authentication

So I’m trying to build a REST API that will use LDAP authentication. Basically, when my login endpoint is consumed, I want it to detect credentials using httpBasic authentication and then use those credentials against my LDAP server. I also want to take into account user roles, protecting endpoints so that only certain users with the proper roles can access

Spring Pageable does not translate @Column name

I have Entity object : And I have database view defined like this: And I have repository with custom query: Everything works fine when I request standard data with url: http://localhost:8080/someEntity/search/findBySomeParameter?parameter=25&page=0&size=20 But when I add sorting information it doesn’t work: http://localhost:8080/someEntity/search/findBySomeParameter?parameter=25&page=0&size=20&sort=entityFieldName,asc will throw following exception (I’m using Oracle database): It seems like sorting field are not translated with @Column(name), but

Advertisement