{"id":22070373,"url":"https://github.com/posinformatique/posinformatique.msbuild.yaml","last_synced_at":"2025-09-09T04:38:50.667Z","repository":{"id":40883794,"uuid":"251158498","full_name":"PosInformatique/PosInformatique.MSBuild.Yaml","owner":"PosInformatique","description":"PosInformatique.MSBuild.Yaml is a MSBuild extension that converts YAML files into JSON format during the compilation of a Visual Studio project (C#, VB. NET, ...).","archived":false,"fork":false,"pushed_at":"2022-12-08T10:06:20.000Z","size":33,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T04:57:50.081Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/PosInformatique.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-29T23:49:09.000Z","updated_at":"2021-02-07T23:45:11.000Z","dependencies_parsed_at":"2023-01-25T06:45:06.496Z","dependency_job_id":null,"html_url":"https://github.com/PosInformatique/PosInformatique.MSBuild.Yaml","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/PosInformatique/PosInformatique.MSBuild.Yaml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PosInformatique%2FPosInformatique.MSBuild.Yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PosInformatique%2FPosInformatique.MSBuild.Yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PosInformatique%2FPosInformatique.MSBuild.Yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PosInformatique%2FPosInformatique.MSBuild.Yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PosInformatique","download_url":"https://codeload.github.com/PosInformatique/PosInformatique.MSBuild.Yaml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PosInformatique%2FPosInformatique.MSBuild.Yaml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271083357,"owners_count":24696276,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-30T20:16:11.537Z","updated_at":"2025-08-19T01:03:03.782Z","avatar_url":"https://github.com/PosInformatique.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PosInformatique.MSBuild.Yaml\nPosInformatique.MSBuild.Yaml is a MSBuild extension that converts YAML files into a JSON during the compilation of a Visual Studio project (C#, VB. NET, ...).\n\nThis extension is very useful when you want to use YAML format for user friendly\nspecifications, but you need to provides a JSON format into your assemblies.\n\nFor example you can use this extension for the following scenario:\n- You can specify a Web API specification using\n[Swagger](https://swagger.io/)/[Open API](https://www.openapis.org/) specifications\nwith a YAML file and you can integrate the JSON file generated into assembly\nwhich can be reused an exposed by [Swashbuckle(https://github.com/domaindrivendev/Swashbuckle.AspNetCore)\n\n## Setting up\n\n[PosInformatique.MSBuild.Yaml](https://github.com/PosInformatique/PosInformatique.MSBuild.Yaml)\nprovides an MSBuild task called `YamlToJson`. This task can be used with two ways:\n- Call the `YamlToJson` MSBuild task explicitly.\n- Declare YAML file to convert automatically before each compilation.\n\nThe [PosInformatique.MSBuild.Yaml](https://www.nuget.org/packages/PosInformatique.MSBuild.Yaml/)\nis available directly on the [NuGet](https://www.nuget.org/) official website.\n\n### Call the `YamlToJson` MSBuild task explicitly.\n\nTo use the `YamlToJson` MSBuild task:\n\n- Install the [PosInformatique.MSBuild.Yaml](https://www.nuget.org/packages/PosInformatique.MSBuild.Yaml/)\npackage using the following command line in the Visual Studio Package Manager console:\n```powershell\nInstall-Package PosInformatique.AspNetCore.Server.AspNet\n```\n\n- Calls the `YamlToJson` tasks in your `.xxproj` file using MSBuild syntax:\n````xml \n\u003cProject\u003e\n  \u003cTarget Name=\"ConvertToJson\"\u003e\n    \u003cYamlToJson YamlInputFile=\"Api.yaml\" JsonOutputFile=\"Api.json\" /\u003e\n  \u003c/Target\u003e\n\u003c/Project\u003e\n````\nThe previous example will converts the YAML content of the `Api.yaml` file into\nJSON format to the `Api.json` file.\n\n### Declare YAML file to convert automatically before each compilation.\n\nThis method allow to generate automatically YAML files before compilation\nof a `.xxproj` file. The input YAML files declared are automatically generated\ninto a `.Designer.json` file.\n\n![Designer Files Example](Documentation/designer-files-example.png)\n\nTo declare YAML files to generate automatically before compilation:\n\n- Install the [PosInformatique.MSBuild.Yaml](https://www.nuget.org/packages/PosInformatique.MSBuild.Yaml/)\npackage using the following command line in the Visual Studio Package Manager console:\n```powershell\nInstall-Package PosInformatique.MSBuild.Yaml\n```\n\n- Updates the `.xxproj` file by declaring the YAML files in the `\u003cYamlToJsonFile\u003e`\ninside an `\u003cItemGroup\u003e` element.\n\n```xml\n\u003cProject\u003e\n  \u003cItemGroup\u003e\n    \u003cYamlToJsonFile Include=\"API.yaml\" WithIndentation=\"false\" /\u003e\n  \u003c/ItemGroup\u003e\n\u003c/Project\u003e\n```\n\nIn the previous example, the `API.yaml` file will be convert into\n`API.Designer.json` JSON file with indentation disabled.\n\nThe `WithIndentation` attribute allow to indent or not the output JSON file. If\nthis option is not specified, the indentation is enabled (it is mean by default\nthe option `WithIndentation` is defined to `true`).\n\n**REMARKS**: It is possible to changes the behavior of the `.Designer.json` file\nto be embedded as resource or copy the file into the output folder of the project.\nDefines the behavior as usual using the `Properties` window inside Visual Studio\nor by customized manually the `.xxproj`.\n\nFor example to include the JSON file generated as embedded resources of the assembly\ncompiled, use the following code:\n```xml \n\u003cItemGroup\u003e\n  \u003cEmbeddedResource Include=\"API.Designer.json\" /\u003e\n\u003c/ItemGroup\u003e\n```\n\n## YamlToJson MSBuild task documentation\n\nThe full documentation of the MSBuild task documentation is specified\nin the [YamlToJson task](./Documentation/YamlToJsonTaskDocumentation.md) page.\n\n## Contributions\nDo not hesitate to clone my code and submit some changes...\nIt is a open source project, so everyone is welcome to improve this library...\n\nBy the way, I am french...\nSo maybe you will remarks that my english is not really fluent...\nSo do not hesitate to fix my resources strings or my documentation... Merci !\n\n## Thanks\nI want to thank the [DiliTrust](https://www.dilitrust.com/) company to test\nand gave me their feedback of this library for their\nSwagger Web API and Kubernetes usage.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposinformatique%2Fposinformatique.msbuild.yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposinformatique%2Fposinformatique.msbuild.yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposinformatique%2Fposinformatique.msbuild.yaml/lists"}