{"id":20548922,"url":"https://github.com/joukevandermaas/saule","last_synced_at":"2025-04-14T11:02:40.025Z","repository":{"id":37927504,"uuid":"42359114","full_name":"joukevandermaas/saule","owner":"joukevandermaas","description":"JSON API library for ASP.Net Web API 2.","archived":false,"fork":false,"pushed_at":"2023-09-20T10:50:41.000Z","size":752,"stargazers_count":76,"open_issues_count":24,"forks_count":37,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T00:11:15.534Z","etag":null,"topics":["asp","ember","ember-data","hacktoberfest","json-api","webapi","webapi-2"],"latest_commit_sha":null,"homepage":"https://joukevandermaas.github.io/saule","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/joukevandermaas.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":"2015-09-12T14:05:55.000Z","updated_at":"2024-05-30T02:16:48.000Z","dependencies_parsed_at":"2024-06-19T09:17:25.111Z","dependency_job_id":"070fdb92-ff91-4c5d-a6d9-aadb171588c0","html_url":"https://github.com/joukevandermaas/saule","commit_stats":{"total_commits":295,"total_committers":31,"mean_commits":9.516129032258064,"dds":0.5186440677966102,"last_synced_commit":"32d34a5b3e5ade8fc81c0976b7b37e487cea72f2"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joukevandermaas%2Fsaule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joukevandermaas%2Fsaule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joukevandermaas%2Fsaule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joukevandermaas%2Fsaule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joukevandermaas","download_url":"https://codeload.github.com/joukevandermaas/saule/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248448216,"owners_count":21105258,"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":["asp","ember","ember-data","hacktoberfest","json-api","webapi","webapi-2"],"created_at":"2024-11-16T02:15:33.550Z","updated_at":"2025-04-14T11:02:39.991Z","avatar_url":"https://github.com/joukevandermaas.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Saule\n[![Build status](https://ci.appveyor.com/api/projects/status/uj3ddt85jaebjuh9/branch/master?svg=true)](https://ci.appveyor.com/project/JoukevanderMaas/saule/branch/master)\n\n\nSaule is a JSON API (version 1.0) library for ASP.Net Web API 2. Install Saule using NuGet:\n\n```\nInstall-Package saule\n```\n\n### [Visit the documentation website](http://joukevandermaas.github.io/saule)\n\nTo use Saule, you must define resources that contain the information\nabout your domain:\n```c#\npublic class PersonResource : ApiResource\n{\n    public PersonResource()\n    {\n        Attribute(\"FirstName\");\n        Attribute(\"LastName\");\n        Attribute(\"Age\");\n\n        BelongsTo\u003cCompanyResource\u003e(\"Job\");\n        HasMany\u003cPersonResource\u003e(\"Friends\");\n    }\n}\npublic class CompanyResource : ApiResource\n{\n    public CompanyResource()\n    {\n        Attribute(\"Name\");\n        Attribute(\"NumberOfEmployees\");\n    }\n}\n```\n\nYou can then use these to serialize any class into Json Api\n(as long as your class has properties with the same names as\nin your model):\n```c#\npublic class PersonController : ApiController\n{\n    [HttpGet]\n    [ReturnsResource(typeof(PersonResource))]\n    [Route(\"people/{id}\")]\n    public JohnSmith GetPerson(string id)\n    {\n        return new JohnSmith();\n    }\n}\n```\n\n```json\nGET http://example.com/people/123\n\n{\n  \"data\": {\n    \"type\": \"person\",\n    \"id\": \"123\",\n    \"attributes\": {\n      \"first-name\": \"John\",\n      \"last-name\": \"Smith\",\n      \"age\": 34\n    },\n    \"relationships\": {\n      \"job\": {\n        \"links\": {\n          \"self\": \"http://example.com/people/123/relationships/job/\",\n          \"related\": \"http://example.com/people/123/job/\"\n        },\n        \"data\": {\n          \"type\": \"company\",\n          \"id\": \"456\"\n        }\n      },\n      \"friends\": {\n        \"links\": {\n          \"self\": \"http://example.com/people/123/relationships/friends/\",\n          \"related\": \"http://example.com/people/123/friends/\"\n        },\n        \"data\": [\n          {\n            \"type\": \"person\",\n            \"id\": \"789\"\n          }\n        ]\n      }\n    }\n  },\n  \"included\": [\n    {\n      \"type\": \"company\",\n      \"id\": \"456\",\n      \"attributes\": {\n        \"name\": \"Awesome, Inc.\",\n        \"number-of-employees\": 24\n      }\n    },\n    {\n      \"type\": \"person\",\n      \"id\": \"789\",\n      \"attributes\": {\n        \"first-name\": \"Sara\",\n        \"last-name\": \"Jones\",\n        \"age\": 38\n      }\n    }\n  ],\n  \"links\": {\n    \"self\": \"http://example.com/people/123\"\n  }\n}\n```\n\nDeserialization works just like in normal Web API; you don't need\nto do anything special to make this work.\n\n### Creating a new release\n\nFollow the steps below to create a new release:\n\n1. Create a branch called `release-v\u003cversion\u003e` (e.g. `release-v1.5`)\n2. Increase the version number in `appveyor.yml` in `master`\n3. Push both changes and wait for the build\n4. Copy the release notes into the release description on Github\n5. Publish the new release","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoukevandermaas%2Fsaule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoukevandermaas%2Fsaule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoukevandermaas%2Fsaule/lists"}