Json Wyam.Json

Parses JSON content for each input document and stores the result in it's metadata.
Parses the content for each input document and then stores a dynamic object representing the JSON in metadata with the specified key. If no key is specified, then the dynamic object is not added. You can also flatten the JSON to add top-level items directly to the document metadata.

Package

This module exists in the Wyam.Json package which is not part of the core distribution. Add the following preprocessor directive to your configuration file to use it:
#n Wyam.Json
Alternativly, you can add all modules at once with the following preprocessor directive:
#n Wyam.All

Usage

  • Json()

    The content of the input document is parsed as JSON. All root-level items are added to the input document's metadata. This is best for simple key-value JSON documents.

  • Json(string key, bool flatten = false)

    The content of the input document is parsed as JSON. A dynamic object representing the JSON content is set as the value for the given metadata key. If flatten is true, all root-level items are also added to the input document's metadata.

    • key

      The metadata key in which to set the dynamic JSON object.

    • flatten

      If set to true, all root-level items are also added to the input document's metadata.

GitHub