{"id":25002571,"url":"https://github.com/siberaindustries/si.endpoints","last_synced_at":"2025-04-12T11:41:20.434Z","repository":{"id":63342226,"uuid":"300412808","full_name":"SiberaIndustries/SI.Endpoints","owner":"SiberaIndustries","description":"Simple ASP.NET Core API Endpoints - The alternative to Controllers and Mediator patterns.","archived":false,"fork":false,"pushed_at":"2023-01-30T21:31:02.000Z","size":75,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T06:23:41.339Z","etag":null,"topics":["annotations","api","aspnetcore","communication","controller","controllers","endpoint","endpoints","mvc","rest","swagger","web"],"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/SiberaIndustries.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-10-01T20:15:30.000Z","updated_at":"2023-02-23T07:51:52.000Z","dependencies_parsed_at":"2023-02-16T11:45:24.849Z","dependency_job_id":null,"html_url":"https://github.com/SiberaIndustries/SI.Endpoints","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiberaIndustries%2FSI.Endpoints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiberaIndustries%2FSI.Endpoints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiberaIndustries%2FSI.Endpoints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiberaIndustries%2FSI.Endpoints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SiberaIndustries","download_url":"https://codeload.github.com/SiberaIndustries/SI.Endpoints/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248563203,"owners_count":21125228,"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":["annotations","api","aspnetcore","communication","controller","controllers","endpoint","endpoints","mvc","rest","swagger","web"],"created_at":"2025-02-04T21:53:02.534Z","updated_at":"2025-04-12T11:41:20.415Z","avatar_url":"https://github.com/SiberaIndustries.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SI.Endpoints\n\n[![NuGet](https://img.shields.io/nuget/v/SI.Endpoints.svg)](https://www.nuget.org/packages/SI.Endpoints)\n[![NuGet](https://img.shields.io/nuget/v/SI.Endpoints.Swagger.svg)](https://www.nuget.org/packages/SI.Endpoints.Swagger)\n[![NuGet](https://img.shields.io/nuget/v/SI.Endpoints.NSwag.svg)](https://www.nuget.org/packages/SI.Endpoints.NSwag)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=SiberaIndustries_SI.Endpoints\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=SiberaIndustries_SI.Endpoints)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=SiberaIndustries_SI.Endpoints\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=SiberaIndustries_SI.Endpoints)\n\n## Introduction\n\nHave fun using this lightweight endpoint API library. No more bloated `Program.cs` files and no more bloated Controllers. This library is in between those two.\n\n## Getting Started\n\n### 1. Install and reference the NuGet package\n\n```\nInstall-Package SI.Endpoints\n```\n\n### 2. Register the Endpoints\n\n```cs\nservices.AddControllers();\nservices.AddEndpointsRouting();\n```\n\n### 3. Create your first Endpoint and have fun\n\n```cs\n// DTOs\npublic record SayHelloRequest(string Name);\npublic record SayHelloResponse(string Message);\n\n// Endpoint\npublic class SayHello : Endpoint\u003cSayHelloRequest, SayHelloResponse\u003e\n{\n    [HttpPost]\n    public override ActionResult\u003cSayHelloResponse\u003e Handle(SayHelloRequest request)\n    {\n        return new SayHelloResponse(\"Hello \" + request.Name);\n    }\n}\n```\n\nCheck out your first endpoint and navigate to: `\u003curi\u003e/SayHello?Name=World!`\n\n## Optionally Configure your endpoints\n\n```cs\nservices.AddControllers();\nservices.AddEndpointsRouting(options =\u003e\n{\n    options.UseFeatures();              // Groups endpoints by the same last namespace part\n    options.WithPrefix(\"Ultra-Api\");    // Adds the given prefix name to all endpoint routes\n});\n```\n\nThe following example shows how endpoints are configured with the given configuration:\n\n```cs\nMyApp.Endpoints.Messaging.HelloEndpoint            // \u003curi\u003e/Ultra-Api/Messaging/SayHello\nMyApp.Endpoints.Messaging.SayGoodByeEndpoint       // \u003curi\u003e/Ultra-Api/Messaging/SayGoodBye\nMyApp.AnotherEndpointNamespace.Calculate.Multiply  // \u003curi\u003e/Ultra-Api/Calculate/Multiply\nMyApp.AnotherEndpointNamespace.Calculate.Subtract  // \u003curi\u003e/Ultra-Api/Calculate/Subtract\n```\n\n## Use the Swagger integration\n\nIf you use swagger, then you will see that every endpoint is grouped separetly. If you want to group them by feature (like a standard controller in mvc), then simply enable the feature filter.\n\n### A. Using Swashbuckle\n\n**1. Install the NuGet-Package**\n\n```\nInstall-Package SI.Endpoints.Swagger\n```\n\n**2. Add `EnableAnnotations()` and `EnableFeatureFilter()` to the Swagger configuration**\n\n```cs\nservices.AddControllers();\nservices.AddEndpointsRouting(options =\u003e options.UseFeatures() });\n\n// Add swagger\nservices.AddSwaggerGen(options =\u003e\n{\n    options.EnableAnnotations();    // Make use of the Annotations\n    options.EnableFeatureFilter();  // Automatically group endpoints by the [feature] template\n    options.SwaggerDoc(\"v1\", new OpenApiInfo { Title = \"Sample endpoints\", Version = \"v1\" });\n});\n```\n\n### B. Using NSwag\n\n**1. Install the NuGet-Package**\n\n```\nInstall-Package SI.Endpoints.NSwag\n```\n\n**2. Add `EnableAnnotations()` and `EnableFeatureFilter()` to the Swagger configuration**\n\n```cs\nservices.AddControllers();\nservices.AddEndpointsRouting(options =\u003e options.UseFeatures() });\n\n// Add swagger\nservices.AddOpenApiDocument(options =\u003e options.EnableFeatureFilter()); // Option A\nservices.AddSwaggerDocument(options =\u003e options.EnableFeatureFilter()); // Option B\n```\n\n## Open Source License Acknowledgements and Third-Party Copyrights\n\n- Icon made by [Freepik](https://www.flaticon.com/authors/freepik)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiberaindustries%2Fsi.endpoints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiberaindustries%2Fsi.endpoints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiberaindustries%2Fsi.endpoints/lists"}