{"id":24783475,"url":"https://github.com/j0rgeserran0/jsonpatch-asp.net-core_5-web-api","last_synced_at":"2026-04-18T00:31:37.901Z","repository":{"id":81626486,"uuid":"319268127","full_name":"J0rgeSerran0/JSONPatch-ASP.NET-Core_5-Web-API","owner":"J0rgeSerran0","description":"JSON Patch in an ASP.NET Core 5 Web API","archived":false,"fork":false,"pushed_at":"2020-12-07T11:36:39.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-23T11:05:14.615Z","etag":null,"topics":["asp-net-core-5","json","json-api","json-patch","net5","patch","web-api"],"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/J0rgeSerran0.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-07T09:28:31.000Z","updated_at":"2020-12-23T13:03:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd565d25-c800-4761-9962-ef5a39a9fde6","html_url":"https://github.com/J0rgeSerran0/JSONPatch-ASP.NET-Core_5-Web-API","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/J0rgeSerran0/JSONPatch-ASP.NET-Core_5-Web-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0rgeSerran0%2FJSONPatch-ASP.NET-Core_5-Web-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0rgeSerran0%2FJSONPatch-ASP.NET-Core_5-Web-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0rgeSerran0%2FJSONPatch-ASP.NET-Core_5-Web-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0rgeSerran0%2FJSONPatch-ASP.NET-Core_5-Web-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/J0rgeSerran0","download_url":"https://codeload.github.com/J0rgeSerran0/JSONPatch-ASP.NET-Core_5-Web-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0rgeSerran0%2FJSONPatch-ASP.NET-Core_5-Web-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31951253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["asp-net-core-5","json","json-api","json-patch","net5","patch","web-api"],"created_at":"2025-01-29T12:17:13.912Z","updated_at":"2026-04-18T00:31:37.862Z","avatar_url":"https://github.com/J0rgeSerran0.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON Patch in an ASP.NET Core 5 Web API\nDemo to show you as use **JSON Patch** in an *ASP.NET Core 5 Web API*\n\n## .NET 5\nThis sample code use .NET 5 and C# as programming language.\n\nYou will find the last [.NET 5 SDK version here](https://dotnet.microsoft.com/download/dotnet/5.0)\n\n## NuGet Packages needed\n- [Microsoft.AspNetCore.Mvc.NewtonsoftJson](https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson/)\n\n\u003e Note that there is another package that is used here, **Microsoft.AspNetCore.JsonPatch**, however, this package is a reference of **Microsoft.AspNetCore.Mvc.NewtonsoftJson**.\n\n## Testing the Web API\n\nStart the Web API and execute the next operations:\n\n### Create new Employee\n**POST** operation to the endpoint **https://localhost:44372/api/employee/**\n\nJSON payload in the *Body*\n\n```csharp\n{\n    \"Name\": \"Charles\",\n    \"Age\": 22\n}\n```\n\nThe response will be a **200 OK** with a *Guid* value that will be the **id** of the employee\n\n\n### Get an Employee by Id\n**GET** operation to the endpoint **https://localhost:44372/api/employee/{id}** where *{id}* is the *Guid* created in the **POST** operation\n\nYou will receive a **200 OK** with a JSON information like:\n\n```csharp\n{\n    \"id\": \"93a5f5e3-dfcf-40dc-9d85-2d0757302d52\",\n    \"name\": \"Charles\",\n    \"age\": 22\n}\n```\n\n\n### Get all the employees\n**GET** operation to the endpoint **https://localhost:44372/api/employee/**\n\nYou will receive a **200 OK** with all the employees, with a JSON information like:\n\n```csharp\n[\n    {\n        \"id\": \"93a5f5e3-dfcf-40dc-9d85-2d0757302d52\",\n        \"name\": \"Frank\",\n        \"age\": 37\n    }\n]\n```\n\n\n### Update some data of an existing employee\n**PATCH** operation to the endpoint **https://localhost:44372/api/employee/update/{id}** where *{id}* is the *Guid* created in the **POST** operation\n\nTo call to this operation, you will have to send a payload with an arry with each operation that you want to do.\n\nIf you want to modify the *Name* and *Age* of an employee, you will have to send two operations in the payload like:\n\n```csharp\n[\n    {\"op\" : \"replace\", \"path\" : \"/Name\", \"value\" : \"Frank\"},\n    {\"op\" : \"replace\", \"path\" : \"/Age\", \"value\" : \"37\"}\n]\n```\n\nYou will receive a **200 OK** with the employee modified:\n\n```csharp\n{\n    \"id\": \"93a5f5e3-dfcf-40dc-9d85-2d0757302d52\",\n    \"name\": \"Frank\",\n    \"age\": 37\n}\n```\n\n## References\n[RFC-6902](https://tools.ietf.org/html/rfc6902)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj0rgeserran0%2Fjsonpatch-asp.net-core_5-web-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj0rgeserran0%2Fjsonpatch-asp.net-core_5-web-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj0rgeserran0%2Fjsonpatch-asp.net-core_5-web-api/lists"}