Skip to main content

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

MethodPathAuthAvailability
GET/healthNoneAll environments
GET/api/greetings?name={name}NoneAll environments
GET/openapi/v1.jsonNoneDevelopment 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 OK when 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 GreetingsControllerGreetingServiceGreeting domain model.

Request

GET /api/greetings?name={name}

Query parameters

NameTypeRequiredDefaultValidation
namestringNo"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 returns 400 Bad Request with a problem-details body (see Errors & Validation).
  • The domain layer additionally trims surrounding whitespace and rejects all-whitespace values; the controller-level StringLength already covers most of this case.

Success response

  • Status: 200 OK
  • Content-Type: application/json
  • Body shape: GreetingResponse
FieldTypeNotes
messagestring"Hello, {name}!" where {name} is the trimmed input.
generatedAtstring (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 OK with Content-Type: application/json containing the OpenAPI v1 document generated by Microsoft.AspNetCore.OpenApi (package Microsoft.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