diff --git a/translation-definitions/src/main/java/eu/europeana/api/translation/definitions/model/TranslationRequest.java b/translation-definitions/src/main/java/eu/europeana/api/translation/definitions/model/TranslationRequest.java index f9367062..06d9f8b9 100644 --- a/translation-definitions/src/main/java/eu/europeana/api/translation/definitions/model/TranslationRequest.java +++ b/translation-definitions/src/main/java/eu/europeana/api/translation/definitions/model/TranslationRequest.java @@ -1,6 +1,7 @@ package eu.europeana.api.translation.definitions.model; import java.util.List; +import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; @@ -27,6 +28,7 @@ public TranslationRequest() { super(); } + @JsonGetter(TranslationAppConstants.SOURCE_LANG) public String getSource() { return source; } @@ -36,6 +38,7 @@ public void setSource(String source) { this.source = source; } + @JsonGetter(TranslationAppConstants.TARGET_LANG) public String getTarget() { return target; } @@ -45,6 +48,7 @@ public void setTarget(String target) { this.target = target; } + @JsonGetter(TranslationAppConstants.SERVICE) public String getService() { return service; } @@ -54,6 +58,7 @@ public void setService(String service) { this.service = service; } + @JsonGetter(TranslationAppConstants.FALLBACK) public String getFallback() { return fallback; } @@ -63,6 +68,7 @@ public void setFallback(String fallback) { this.fallback = fallback; } + @JsonGetter(TranslationAppConstants.TEXT) public List getText() { return text; } @@ -80,6 +86,7 @@ public boolean useCaching() { return caching; } + @JsonGetter(TranslationAppConstants.CACHING) public Boolean getCaching() { return caching; } diff --git a/translation-web/src/main/java/eu/europeana/api/translation/web/TranslationController.java b/translation-web/src/main/java/eu/europeana/api/translation/web/TranslationController.java index 3ab233b6..0cb93fca 100644 --- a/translation-web/src/main/java/eu/europeana/api/translation/web/TranslationController.java +++ b/translation-web/src/main/java/eu/europeana/api/translation/web/TranslationController.java @@ -13,9 +13,9 @@ import eu.europeana.api.commons.web.http.HttpHeaders; import eu.europeana.api.commons.web.model.vocabulary.Operations; import eu.europeana.api.translation.definitions.language.LanguagePair; -import eu.europeana.api.translation.definitions.vocabulary.TranslationAppConstants; import eu.europeana.api.translation.definitions.model.TranslationRequest; import eu.europeana.api.translation.definitions.model.TranslationResponse; +import eu.europeana.api.translation.definitions.vocabulary.TranslationAppConstants; import eu.europeana.api.translation.web.exception.ParamValidationException; import eu.europeana.api.translation.web.service.TranslationWebService; import io.swagger.v3.oas.annotations.tags.Tag; @@ -39,6 +39,10 @@ public ResponseEntity translate(@RequestBody TranslationRequest translRe verifyWriteAccess(Operations.CREATE, request); validateRequest(translRequest); + + if(logger.isTraceEnabled()) { + logger.trace("Translation request: " + jsonLdSerializer.serializeObject(translRequest)); + } TranslationResponse result = translationService.translate(translRequest);