File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/main/java/fr/insee/genesis/controller/rest/responses Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11package fr .insee .genesis .controller .rest .responses ;
22
3+ import com .fasterxml .jackson .core .JsonProcessingException ;
34import com .fasterxml .jackson .databind .DeserializationFeature ;
45import com .fasterxml .jackson .databind .ObjectMapper ;
56import com .fasterxml .jackson .databind .SerializationFeature ;
@@ -150,16 +151,18 @@ public ResponseEntity<String> saveRawResponsesFromJsonBodyWithValidationDeprecat
150151 @ PreAuthorize ("hasRole('COLLECT_PLATFORM')" )
151152 public ResponseEntity <String > saveRawResponsesFromJsonBodyWithValidation (
152153 @ RequestBody Map <String , Object > body
153- ) {
154+ ) throws JsonProcessingException {
155+
154156 ObjectMapper objectMapperLocal = new ObjectMapper ();
155157 objectMapperLocal .registerModule (new JavaTimeModule ());
156158 objectMapperLocal .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS ); // ISO-8601
157159 objectMapperLocal .disable (DeserializationFeature .ADJUST_DATES_TO_CONTEXT_TIME_ZONE );
158160
161+ log .info (objectMapperLocal .writeValueAsString (body ));
159162 try {
160163 RawResponseDto rawResponseDto = JsonSchemaValidator .readAndValidateFromClasspath (
161- ExtendedJsonNormalizer .normalize (new ObjectMapper () .readTree (
162- new ObjectMapper () .writeValueAsString (body ))),
164+ ExtendedJsonNormalizer .normalize (objectMapperLocal .readTree (
165+ objectMapperLocal .writeValueAsString (body ))),
163166 SchemaType .RAW_RESPONSE .getSchemaFileName (),
164167 RawResponseDto .class ,
165168 objectMapperLocal
You can’t perform that action at this time.
0 commit comments