dasiths / simpleendpoints Goto Github PK
View Code? Open in Web Editor NEWA simple, convention-based, endpoint per action pattern implementation for AspNetCore 3.0+ with full support for Swagger
License: MIT License
A simple, convention-based, endpoint per action pattern implementation for AspNetCore 3.0+ with full support for Swagger
License: MIT License
Hi mate,
I found this little project on Twitter earlier today and really liked the idea. Since I am in lockdown at the moment I thought I would pull the code and see what I could come up with to help.
The first thing I did was add Swashbuckle so I could visualise what was going on, there were a few issues with this. The main one was that the Swahbuckle.AspNet
library does not consider inherited attributes when scanning routes which was a problem. I solved this by tapping into the IApiDescriptionGroupCollectionProvider
and setting the HttpMethod
. This gave me an idea that we could do away with the HttpVerb
attributes on all endpoints and I have achieved this by setting a marker interface on each of the 4 abstract verb scoped endpoints and then looking at the inheritance tree during applying the EndpointRoutingConvention
. I have also included the ability to set a global route segment api/
as an example and also set a naming convention token to be used for registering the routes against endpoint names.
Anyway, if you are interested in having me create a PR please go ahead and open up permissions for non-master branches.
I look forward to hearing from you. I have a couple more ideas how we may be able to make this a really cool little library.
Cool & thanks.
Jony.
It should not do NuGet deployments for PR builds.
Hi @dasiths , this pattern is beautiful and simple.
Is this possible with legacy ASP.NET Web API?
If so, can you share a guide to apply this on old ASP.NET projects without Owin?
Thank you.
var containsEndpointRouteToken =
routeTemplate.IndexOf(SimpleEndpointBase.EndpointRouteToken, StringComparison.OrdinalIgnoreCase) >= 0;
var containsPrefixRouteToken =
routeTemplate.IndexOf(SimpleEndpointBase.EndpointPrefixRouteToken, StringComparison.OrdinalIgnoreCase) >= 0;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.