Skip to content

Commit d5e5464

Browse files
committed
chore: add log
1 parent 3ec9600 commit d5e5464

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/fr/insee/genesis/controller/rest/responses/RawResponseController.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fr.insee.genesis.controller.rest.responses;
22

3+
import com.fasterxml.jackson.core.JsonProcessingException;
34
import com.fasterxml.jackson.databind.DeserializationFeature;
45
import com.fasterxml.jackson.databind.ObjectMapper;
56
import 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

0 commit comments

Comments
 (0)