POC of Go transformation libraries#62
Merged
Merged
Conversation
The Go structs allow representation of full content tree and converting a JSON content tree to Go objects (unmarshalling). Add Go mod definition in the main dir of the project. This implementation returns an error during unmarshalling if the tree does not adhere to the JSON schema, including when the node type is "undefined".
The Go transformer (JSON tree -> plain text) uses the contenttree package and its base content tree representation. The whole content tree is unmashalled into Go objects thus the input of the transformer needs to comply to the contenttree package implementation.
The update is moving from content tree body as input of the test to content tree root. This assumes that the transformer should receive the whole content tree, starting from the root.
Remove double spaces from the output of the test cases for content tree to plain text transformers.
The trasformer relies on the content tree representation in the main contenttree package. The implementation is not completed and does not pass the unit tests.
Contributor
|
this is really exciting!!! for what it's worth i very 100% approve of the structure of the go libs, and am pumped! |
adgad
approved these changes
Mar 5, 2025
chee
approved these changes
Mar 5, 2025
Contributor
chee
left a comment
There was a problem hiding this comment.
let's get this in, and get started
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an incomplete POC for introducing Go libraries transforming content tree to plain text and to "external" bodyXML. It is based on PR #51.
The format of the "external"
bodyXMLis what is described as Body Format IV - this is what is currently retrieved from Content and Enriched Content APIs with policyINCLUDE_RICH_CONTENT.Since the full implementation has not been finalised at this stage, this PR seeks endorsement specifically for:
A. Including Go libraries in this repository with the proposed structure and developing them alongside changes to the content tree definition.
B. Aligning on a commitment to collaborate on resolving the remaining TODOs. The transformation to “external” bodyXML intentionally includes multiple TODOs, reflecting open questions regarding tags that still require solutions. These TODOs could serve as a useful reference to assess how well the current content tree definition accommodates old content.
Please note that the proposed implementations does not pass the unit tests.
I know that this is a long PR but the C&M needed a POC that we can indeed adopt content tree as the primary body format in the platform.