{"id":18603009,"url":"https://github.com/devlooped/yaml","last_synced_at":"2025-11-02T10:30:27.067Z","repository":{"id":40308306,"uuid":"406739595","full_name":"devlooped/yaml","owner":"devlooped","description":"YamlPeek MSBuild Task","archived":false,"fork":false,"pushed_at":"2025-02-07T14:11:21.000Z","size":94,"stargazers_count":1,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T15:20:02.926Z","etag":null,"topics":["dotnet","msbuild","yaml","yml"],"latest_commit_sha":null,"homepage":"https://clarius.org/yaml","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devlooped.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":".github/contributing.md","funding":".github/FUNDING.yml","license":"license.txt","code_of_conduct":".github/code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":".github/support.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"devlooped"}},"created_at":"2021-09-15T11:43:22.000Z","updated_at":"2025-02-07T14:10:30.000Z","dependencies_parsed_at":"2025-02-07T15:19:57.195Z","dependency_job_id":"5651be46-4c74-4744-993c-32260fb5d012","html_url":"https://github.com/devlooped/yaml","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlooped%2Fyaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlooped%2Fyaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlooped%2Fyaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlooped%2Fyaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devlooped","download_url":"https://codeload.github.com/devlooped/yaml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239394671,"owners_count":19631117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","msbuild","yaml","yml"],"created_at":"2024-11-07T02:13:12.687Z","updated_at":"2025-11-02T10:30:27.037Z","avatar_url":"https://github.com/devlooped.png","language":"C#","funding_links":["https://github.com/sponsors/devlooped"],"categories":[],"sub_categories":[],"readme":"![Yaml Icon](https://raw.githubusercontent.com/devlooped/yaml/main/assets/img/icon.png) YamlPeek MSBuild Task\n============\n\n[![Version](https://img.shields.io/nuget/vpre/YamlPeek.svg?color=royalblue)](https://www.nuget.org/packages/YamlPeek)\n[![Downloads](https://img.shields.io/nuget/dt/YamlPeek.svg?color=green)](https://www.nuget.org/packages/YamlPeek)\n[![License](https://img.shields.io/github/license/devlooped/yaml.svg?color=blue)](https://github.com/devlooped/yaml/blob/main/license.txt)\n[![Build](https://github.com/devlooped/yaml/workflows/build/badge.svg?branch=main)](https://github.com/devlooped/yaml/actions)\n\nRead values from yaml files using JSONPath query expressions.\n\n\nUsage:\n\n```xml\n  \u003cYamlPeek ContentPath=\"[YAML_FILE]\" Query=\"[JSONPath]\"\u003e\n    \u003cOutput TaskParameter=\"Result\" PropertyName=\"Value\" /\u003e\n  \u003c/YamlPeek\u003e\n  \u003cYamlPeek Content=\"[YAML]\" Query=\"[JSONPath]\"\u003e\n    \u003cOutput TaskParameter=\"Result\" ItemName=\"Values\" /\u003e\n  \u003c/YamlPeek\u003e\n```\n\nParameters:\n\n| Parameter   | Description                                                                                                    |\n| ----------- | -------------------------------------------------------------------------------------------------------------- |\n| Content     | Optional `string` parameter.\u003cbr/\u003eSpecifies the YAML input as a string.                           |\n| ContentPath | Optional `ITaskItem` parameter.\u003cbr/\u003eSpecifies the YAML input as a file path.                                   |\n| Query       | Required `string` parameter.\u003cbr/\u003eSpecifies the [JSONPath](https://goessner.net/articles/JsonPath/) expression. |\n| Result      | Output `ITaskItem[]` parameter.\u003cbr/\u003eContains the results that are returned by the task.                        |\n\nYou can either provide the path to a YAML file via `ContentPath` or \nprovide the straight YAML content to `Content`. The `Query` is a \n[JSONPath](https://goessner.net/articles/JsonPath/) expression that is evaluated \nand returned via the `Result` task parameter. You can assign the resulting \nvalue to either a property (i.e. for a single value) or an item name (i.e. \nfor multiple results).\n\nYAML object properties are automatically projected as item metadata when \nassigning the resulting value to an item. For example, given the following JSON:\n\n```yaml\nhttp:\n  host: localhost\n  port: 80\n  ssl: true\n```\n\nYou can read the entire `http` value as an item with each property as a metadata \nvalue with:\n\n```xml\n\u003cYamlPeek ContentPath=\"host.yaml\" Query=\"$.http\"\u003e\n    \u003cOutput TaskParameter=\"Result\" ItemName=\"Http\" /\u003e\n\u003c/YamlPeek\u003e\n```\n\nThe `Http` item will have the following values (if it were declared in MSBuild):\n\n```xml\n\u003cItemGroup\u003e\n    \u003cHttp Include=\"[item raw json]\"\u003e\n        \u003chost\u003elocalhost\u003c/host\u003e\n        \u003cport\u003e80\u003c/port\u003e\n        \u003cssl\u003etrue\u003c/ssl\u003e\n    \u003c/Http\u003e\n\u003c/ItemGroup\u003e\n```\n\nThese item metadata values could be read as MSBuild properties as follows, for example:\n\n```xml\n\u003cPropertyGroup\u003e\n    \u003cHost\u003e@(Http -\u003e '%(host)')\u003c/Host\u003e\n    \u003cPort\u003e@(Http -\u003e '%(port)')\u003c/Port\u003e\n    \u003cSsl\u003e@(Http -\u003e '%(ssl)')\u003c/Ssl\u003e\n\u003c/PropertyGroup\u003e\n```\n\nIn addition to the explicitly opted in object properties, the entire node is available \nas raw YAML via the special `_` (single underscore) metadata item.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlooped%2Fyaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevlooped%2Fyaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlooped%2Fyaml/lists"}