.NET API Reference (OpenAPI)¶
Auto-generated
This page is rendered from docs/generated/openapi.json — the
OpenAPI 3.1.1 document that dotnet build emits
at build time from the MyApp.Api controllers via native
Microsoft.AspNetCore.OpenApi generation (no Swashbuckle
reflection). Re-render with python3 scripts/generate-openapi-docs.py
after rebuilding the solution.
| Field | Value |
|---|---|
| OpenAPI version | 3.1.1 |
| Document version | 1.0.0 |
| Title | MyApp.Api \| v1 |
| Generated by | native build-time OpenAPI generation (dotnet build) |
| Raw document | openapi.json |
| Related Requirements | MoSCoW Prioritisation |
Endpoint Inventory¶
| Method | Route | Summary |
|---|---|---|
| GET | /api/todos |
Lists all todo items. |
| POST | /api/todos |
Creates a new todo item. |
| GET | /api/todos/{id} |
Returns a single todo item by identifier. |
| PATCH | /api/todos/{id} |
Sets the completion state of a todo item. |
| DELETE | /api/todos/{id} |
Deletes a todo item. |
Endpoints¶
GET /api/todos¶
Lists all todo items.
Responses:
| Status | Description | Schema |
|---|---|---|
| 200 | Every todo item currently stored. | array of TodoDto |
POST /api/todos¶
Creates a new todo item.
Request body (application/json): CreateTodoRequest
Responses:
| Status | Description | Schema |
|---|---|---|
| 201 | Created | TodoDto |
| 400 | The request body is missing or has an empty title. | ProblemDetails |
GET /api/todos/{id}¶
Returns a single todo item by identifier.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string |
True | The identifier of the item. |
Responses:
| Status | Description | Schema |
|---|---|---|
| 200 | OK | TodoDto |
| 404 | No item with the given identifier exists. | ProblemDetails |
PATCH /api/todos/{id}¶
Sets the completion state of a todo item.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string |
True | The identifier of the item. |
Request body (application/json): boolean
Responses:
| Status | Description | Schema |
|---|---|---|
| 200 | OK | TodoDto |
| 404 | No item with the given identifier exists. | ProblemDetails |
DELETE /api/todos/{id}¶
Deletes a todo item.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string |
True | The identifier of the item. |
Responses:
| Status | Description | Schema |
|---|---|---|
| 204 | No Content | — |
| 404 | No item with the given identifier exists. | ProblemDetails |
Schemas¶
CreateTodoRequest¶
Data for creating a new todo item.
| Property | Type | Required | Description |
|---|---|---|---|
title |
string |
True | The title of the new item. |
ProblemDetails¶
| Property | Type | Required | Description |
|---|---|---|---|
type |
null/string (nullable) |
False | |
title |
null/string (nullable) |
False | |
status |
integer/null/string (nullable) |
False | |
detail |
null/string (nullable) |
False | |
instance |
null/string (nullable) |
False |
TodoDto¶
Data-transfer shape of a todo item exposed by the application layer.
| Property | Type | Required | Description |
|---|---|---|---|
id |
string |
True | The stable identifier of the item. |
title |
string |
True | The human-readable title of the item. |
isCompleted |
boolean |
True | A value indicating whether the item is done. |
Traceability¶
The OpenAPI document is a traceable pipeline artefact: it is generated deterministically at build time, rendered into this page, and linked into the traceability matrix. See the Traceability Matrix for the full chain from MoSCoW requirements to ADRs, policies, and code.
The native Microsoft.AspNetCore.OpenApi build-time generation
approach (over Swashbuckle) will be recorded in an upcoming ADR as
part of the .NET ADR series.