strong-kite-64511
07/18/2023, 5:58 PM{"exceptionClass":"com.linkedin.restli.server.RestLiServiceException","stackTrace":"com.linkedin.restli.server.RestLiServiceException [HTTP Status:422]: Failed to validate record with class
models.TicketProperties: ERROR :: /value :: unrecognized field found but not allowed\nERROR :: /contentType :: unrecognized field found but not allowed\nERROR :: /ticket_properties :: field is required but not found and has no default value\n\n\tat com.linkedin.metadata.resources.entity.AspectResource.lambda$ingestProposal$3(AspectResource.java:200)\n\tat com.linkedin.metadata.restli.RestliUtil.toTask(RestliUtil.java:30)\n\tat
...........
I am formulating my MCPW like this:
MetadataChangeProposalWrapper mcpw = MetadataChangeProposalWrapper.builder()
.entityType("dataset")
.entityUrn("urn:li:dataset:(urn:li:dataPlatform:my_platform,foo,TEST)")
.upsert()
.aspect(new GenericAspect().setContentType("application/json").setValue(byteString))
.aspectName("ticketTabular")
.build();
The byteString is generated as follows:
ObjectNode jsonObject = objectMapper.createObjectNode();
jsonObject.set("ticket_properties", objectMapper.valueToTree(properties));
String jsonObjectString = objectMapper.writeValueAsString(jsonObject);
ByteString byteString = ByteString.copyString(jsonObjectString, StandardCharsets.UTF_8);delightful-ram-75848
07/19/2023, 7:33 AMbland-orange-13353
07/19/2023, 7:33 AM