Converts objects stored in metadata or elsewhere to JSON.
- Namespace
- Statiq
.Core - Interfaces
- Base Types
-
- object
- Module
- ParallelConfigModule
<object> - Parallel
Sync Config Module <object>
graph BT
Type-->Base0["ParallelSyncConfigModule<object>"]
Base0-->Base1["ParallelConfigModule<object>"]
Base1-->Base2["Module"]
click Base2 "/api/Statiq.Common/Module"
Base2-->Base3["object"]
Type-.->Interface0["IModule"]
click Interface0 "/api/Statiq.Common/IModule"
Type-.->Interface1["IParallelModule"]
click Interface1 "/api/Statiq.Common/IParallelModule"
Type["GenerateJson"]
class Type type-node
Syntax
public class GenerateJson : ParallelSyncConfigModule<object>, IModule, IParallelModule
Remarks
Generates JSON for a specified object (which can come from document metadata or elsewhere)
and stores it as new content for each input document or in each document's metadata.
Constructors
Name | Summary |
---|---|
GenerateJson |
Allows you to specify metadata keys for each input document that should be serialized as properties in a JSON object. |
GenerateJson |
The object returned by the specified delegate is converted to JSON, which then either replaces the content of each input document or is stored in the specified metadata key. |
GenerateJson |
The object stored in metadata at the specified key is converted to JSON, which then either replaces the content of each input document or is stored in the specified metadata key. |
Methods
Name | Return Value | Summary |
---|---|---|
AfterExecution |
void |
Called after each module execution.
Inherited from Module
|
AfterExecutionAsync |
Task |
Called after each module execution.
Inherited from Module
|
BeforeExecution |
void |
Called before each module execution.
Inherited from Module
|
BeforeExecutionAsync |
Task |
Called before each module execution.
Inherited from Module
|
ExecuteAsync |
Task |
This should not be called directly, instead call
IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
|
ExecuteConfig |
IEnumerable |
|
Finally |
void |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
FinallyAsync |
Task |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
WithCamelCase |
GenerateJson |
Specifies whether the generated JSON should use a camel case naming strategy for property names.
The default behavior is not to generate camel case property names.
|
WithIndenting |
GenerateJson |
Specifies whether the generated JSON should be indented.
|
WithSettings |
GenerateJson |
Allows changing the JSON serializer options.
|