07-12-2022 02:45 PM
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); }
08-16-2022 09:59 AM
Up
Explore our Alfresco products with the links below. Use labels to filter content by product module.