Endpoint Reference
Every endpoint that exists in the Wrapsfer API today. Examples assume the API is running at http://localhost:8080 (the Docker Compose default). Substitute your own host and port — see Getting Started for the launch-profile defaults.
Quick Index
| Method | Path | Auth | Availability |
|---|---|---|---|
GET | /health | None | All environments |
GET | /api/greetings?name={name} | None | All environments |
GET | /openapi/v1.json | None | Development only |
No endpoint requires authentication today; see the API Overview for what is intentionally not implemented.
GET /health
Health check exposed via app.MapHealthChecks("/health"). Backed by ASP.NET Core's HealthChecks services with no custom checks registered, so it returns the aggregate status of the (currently empty) check set.
Request
GET /health
No headers, query string, or body required.
Response
- Status:
200 OKwhen the service is healthy. - Content-Type:
text/plain - Body: the ASP.NET Core default health-status string, e.g.
Healthy.
curl -i http://localhost:8080/health
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 7
Healthy
The integration test HealthEndpointTests.Health_ReturnsOk asserts the 200 OK status.
GET /api/greetings
Sample endpoint that returns a greeting message. Demonstrates request flow through GreetingsController → GreetingService → Greeting domain model.
Request
GET /api/greetings?name={name}
Query parameters
| Name | Type | Required | Default | Validation |
|---|---|---|---|---|
name | string | No | "World" | [StringLength(80, MinimumLength = 1)] — between 1 and 80 characters when supplied. |
name validation rules:
- If the parameter is omitted, the controller default
"World"is used and validation passes. - If the parameter is supplied, it must be 1–80 characters. An empty string (
?name=) or a value longer than 80 characters fails model validation and returns400 Bad Requestwith a problem-details body (see Errors & Validation). - The domain layer additionally trims surrounding whitespace and rejects all-whitespace values; the controller-level
StringLengthalready covers most of this case.
Success response
- Status:
200 OK - Content-Type:
application/json - Body shape:
GreetingResponse
| Field | Type | Notes |
|---|---|---|
message | string | "Hello, {name}!" where {name} is the trimmed input. |
generatedAt | string (ISO 8601 timestamp) | UTC instant from the registered TimeProvider (TimeProvider.System by default). |
JSON property names are camelCase (ASP.NET Core's default for response serialization).
Examples
Default greeting (no name supplied):
curl -i "http://localhost:8080/api/greetings"
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{"message":"Hello, World!","generatedAt":"2026-05-02T08:00:00+00:00"}
Greeting with a name query parameter:
curl -i "http://localhost:8080/api/greetings?name=Vernon"
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{"message":"Hello, Vernon!","generatedAt":"2026-05-02T08:00:00+00:00"}
The integration test GreetingsEndpointTests.Get_ReturnsGreeting asserts a 200 OK and message == "Hello, Vernon!" for ?name=Vernon. The unit test GreetingTests.Create_TrimsNameAndFormatsMessage asserts that input " Vernon " becomes "Hello, Vernon!".
Validation failure example
Empty name value (fails MinimumLength = 1):
curl -i "http://localhost:8080/api/greetings?name="
Returns 400 Bad Request with an application/problem+json body. See Errors & Validation for the full validation contract.
GET /openapi/v1.json
OpenAPI document for the API. Mapped via app.MapOpenApi() and gated behind app.Environment.IsDevelopment() in Program.cs, so it is only available when ASPNETCORE_ENVIRONMENT=Development.
Request
GET /openapi/v1.json
Response
- In
Development:200 OKwithContent-Type: application/jsoncontaining the OpenAPI v1 document generated byMicrosoft.AspNetCore.OpenApi(packageMicrosoft.AspNetCore.OpenApi 10.0.7). - In any other environment: the route is not mapped, so the request returns
404 Not Found.
curl -i http://localhost:8080/openapi/v1.json
The default launch profiles in src/Wrapsfer.Api/Properties/launchSettings.json set ASPNETCORE_ENVIRONMENT=Development, and the supplied docker-compose.yml sets the same — so the document is reachable in both default local flows. Promoting the API to a non-Development environment without changing Program.cs will hide this endpoint.
For more on the OpenAPI document itself, see the OpenAPI page.
See Also
- API Overview — what the API is and what is intentionally not included.
- Getting Started — run the API locally and call these endpoints.
- Errors & Validation — error contract and validation behavior.
- OpenAPI — accessing the generated OpenAPI document.