Skip to content
Discussion options

You must be logged in to vote

@MarianBaba You can use the JsonSerializer service to generate such a JSON document. It is available in the language injection container.

/**
* Utility service for transforming an `AstNode` into a JSON string and vice versa.
*/
export interface JsonSerializer {
/**
* Serialize an `AstNode` into a JSON `string`.
* @param node The `AstNode` to be serialized.
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
*/
serialize(node: AstNode, options?: JsonSerializeOptions): s…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by MarianBaba
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants