The integration field feature is actually in beta, and we want to retrieve the data fetched from the integration field through the java-kit. But it is not possible right now because the fragment returned from the api has no "type" and then won't be parsed (the parseFragment method returns null when type is unknown).
This PR adds the support of the integration field (and any other unknown field) by parsing any unknown fragment to a Raw fragment which exposes the raw json as JsonNode (with getValue method) and as String (with asText method).
When parsing a document, any unknown fragment will then be parsed as a Raw fragment instead of null.
When a "type" will be added for integration field fragments, we willl be able to add a new specific fragment type in java-kit. But we will also keep the Raw fragment, which can handle any future unknown fragment.
Hello Prismic team,
The integration field feature is actually in beta, and we want to retrieve the data fetched from the integration field through the java-kit. But it is not possible right now because the fragment returned from the api has no
"type"
and then won't be parsed (theparseFragment
method returnsnull
when type is unknown).This PR adds the support of the integration field (and any other unknown field) by parsing any unknown fragment to a
Raw
fragment which exposes the raw json asJsonNode
(withgetValue
method) and as String (withasText
method). When parsing a document, any unknown fragment will then be parsed as aRaw
fragment instead ofnull
.When a
"type"
will be added for integration field fragments, we willl be able to add a new specific fragment type in java-kit. But we will also keep theRaw
fragment, which can handle any future unknown fragment.This PR depends on #64
Thanks!