-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Export/import of JSON metadata (#1622)
Metadata in `hugr-core` is attached to nodes and to `OpDef`s, consisting of a map from string names to `serde_json::Value`s. On top of that, `OpDef` also has a `description` field. This PR imports and exports node metadata by serializing it to a JSON string and wrapping that string with a `prelude.json` constructor. It also exports the metadata of `OpDef`s, in which case the description field can be exported as a string directly. This PR also introduces string escaping for the text format (#1549). By wrapping the metadata in a JSON type on the `hugr-model` side, we leave open the option to have typed metadata via the usual term system in the future. Closes #1631.
- Loading branch information
Showing
11 changed files
with
216 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.