Filippo D'Errigo Ideas, notes & experiments
Source Code Live

Api Starter Kit - Asp.Net Core

C# ASP.NET Core 7.0 OpenAPI v3 Swagger Docker
Api Starter Kit  - Asp.Net Core
Source code github.com/fderrigo/api-starter-kit-aspnetcore


ASP.NET Core template for designing and publishing interoperable REST APIs in line with the AgID Guidelines on the Interoperability Model.

The project was created as a starting point for anyone who needs to expose services compliant with Italian public administration standards, with a clear approach: first you define the API contract, then you generate the application skeleton, and finally you implement the service logic.

Design-first approach

The project follows a design-first model:

  1. you write the specifications in OpenAPI v3 format;
  2. you generate the code skeleton using the Swagger tools;
  3. you implement the application methods, keeping the API contract as the main reference.

This makes the API more readable, easier to document, and aligned with interoperability standards from the very beginning.

Demo service

The template includes a demo service called Ora esatta ("Exact time"), made up of two endpoints:

  • GET /datetime/v1/echo
    returns a server timestamp in RFC5424 format;
  • GET /datetime/v1/status
    returns the service status.

The endpoints are not just simple "happy path" examples: they simulate the realistic behavior of a production service, including errors and operational limits.

Simulated behaviors

The project includes:

  • error handling in problem+json format, according to RFC 7807;
  • rate limiting headers, including X-RateLimit-* and Retry-After;
  • randomly generated error responses, such as 503 Service Unavailable and 429 Too Many Requests, useful for testing client resilience.

The OpenAPI specifications can still be browsed via Swagger UI, so you can explore and test the endpoints directly from your browser.

Repository

Original repository:
https://github.com/fderrigo/api-starter-kit-aspnetcore

The project was later forked by Team Digitale into the official repository of the Piano Triennale ICT (the Italian Three-Year ICT Plan):
https://github.com/teamdigitale/api-starter-kit-aspnetcore

Share
Back to the Lab