{"id":16075292,"url":"https://github.com/ricardoboss/dartlang.pubspec","last_synced_at":"2026-01-25T12:31:23.671Z","repository":{"id":242227026,"uuid":"809019028","full_name":"ricardoboss/DartLang.PubSpec","owner":"ricardoboss","description":"A library to read/write Dart pubspec.yaml files","archived":false,"fork":false,"pushed_at":"2025-04-08T19:30:32.000Z","size":117,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T13:53:01.176Z","etag":null,"topics":["dart","deserialization","dotnet","pubspec","pubspec-yaml","serialization"],"latest_commit_sha":null,"homepage":"https://nuget.org/packages/DartLang.PubSpec","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/ricardoboss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-01T13:02:42.000Z","updated_at":"2025-04-10T09:35:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"a946df50-431e-4485-bced-c771eb0cf419","html_url":"https://github.com/ricardoboss/DartLang.PubSpec","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"751a9aa5540cda43ce0d0843d525e3ddaa202ff9"},"previous_names":["ricardoboss/dartlang.pubspec"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ricardoboss/DartLang.PubSpec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardoboss%2FDartLang.PubSpec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardoboss%2FDartLang.PubSpec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardoboss%2FDartLang.PubSpec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardoboss%2FDartLang.PubSpec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricardoboss","download_url":"https://codeload.github.com/ricardoboss/DartLang.PubSpec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardoboss%2FDartLang.PubSpec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28752965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dart","deserialization","dotnet","pubspec","pubspec-yaml","serialization"],"created_at":"2024-10-09T09:03:53.921Z","updated_at":"2026-01-25T12:31:23.654Z","avatar_url":"https://github.com/ricardoboss.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DartLang.PubSpec\n\nA library to serialize and deserialize Dart pubspec.yaml files.\n\n## Usage\n\n```csharp\nvar yaml = File.ReadAllText(\"pubspec.yaml\");\nvar pubspec = PubSpecYamlSerializer.Deserialize(yaml);\n\nConsole.WriteLine($\"Name: {pubspec.Name}\");\nConsole.WriteLine($\"Version: {pubspec.Version}\");\n```\n\nYou can also use the JSON serializer:\n\n```csharp\nvar json = File.ReadAllText(\"pubspec.json\");\nvar pubspec = PubSpecJsonSerializer.Deserialize(json);\n```\n\n### Custom Deserializer\n\n#### YAML\n\nYou can also build your own deserializer using [`YamlDotNet`] directly:\n\n```csharp\nvar deserializer = new DeserializerBuilder()\n    .IgnoreUnmatchedProperties()                                // pub.dev will ignore other properties\n    .WithNamingConvention(UnderscoredNamingConvention.Instance) // dart uses underscores for properties\n    .WithPubSpecConverters()                                    // converters for custom types\n    .Build();\n\nreturn deserializer.Deserialize\u003cPubSpec\u003e(reader);\n```\n\n#### JSON\n\nIn case you need to use custom `JsonSerializerOptions`, you can reuse the converters from `DartLang.PubSpec.Serialization.Json`:\n\n```csharp\nvar json = File.ReadAllText(\"pubspec.json\");\nvar options = new JsonSerializerOptions\n{\n    PropertyNameCaseInsensitive = true,\n    PropertyNamingPolicy = JsonNamingPolicy.CamelCase,\n    Converters =\n    {\n        new SemVersionJsonConverter(),\n        new SemVersionRangeJsonConverter(),\n        new DependencyMapJsonConverter(),\n        new PlatformsJsonConverter(),\n    },\n};\n\nreturn JsonSerializer.Deserialize\u003cPubSpec\u003e(json, options);\n```\n\n### Serialization\n\nSerialization is currently not supported, but should not be hard to implement yourself.\n\n## License\n\nMIT\n\n[`YamlDotNet`]: https://github.com/aaubry/YamlDotNet\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardoboss%2Fdartlang.pubspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricardoboss%2Fdartlang.pubspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardoboss%2Fdartlang.pubspec/lists"}