I created an API that will consume Alfresco APIs. Why am I getting null values when i consume the endpoint from my service?
The endpoint
http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/audit-applications/tagging
return
{ "entry": { "isEnabled": true, "name": "Alfresco Tagging Service", "id": "tagging" } }
But when i call
localhost:8081/api/v1/audit-applications/tagging
that will consume Alfresco by Feign Client return
{ "id": null, "name": null, "isEnabled": true }
AuditApp:
@Validated @Builder @Data @AllArgsConstructor @NoArgsConstructor public class AuditApp implements Serializable { private static final long serialVersionUID = 3711249989390965220L; @NotNull private String id; private String name; @Builder.Default private Boolean isEnabled = true; }
The Feign Client:
@GetMapping(value = "/audit-applications/{auditApplicationId}") ResponseEntity<AuditApp> getAuditApp(@PathVariable("auditApplicationId") String auditApplicationId, @RequestParam(value = "fields", required = false) List<String> fields);
The Controller:
@GetMapping("/audit-applications/{auditApplicationId}") public ResponseEntity<AuditApp> getAuditApp(@PathVariable("auditApplicationId") String auditApplicationId, @RequestParam(value = "fields", required = false) List<String> fields) { ResponseEntity<AuditApp> auditApp = auditApiClient.getAuditApp(auditApplicationId, fields); return new ResponseEntity<AuditApp>(auditApp.getBody(), HttpStatus.OK); }
Up
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.