Language

InvocationHandler.GetAsyncApiYamlAsync Method

Definition

Handles GET /invocations/docs/asyncapi.yaml. Returns 404 by default. Override to return an AsyncAPI (YAML) spec for the agent's event-driven contract. Companion to GetAsyncApiJsonAsync(HttpRequest, HttpResponse, CancellationToken); each format is served independently at its own path.

public virtual System.Threading.Tasks.Task GetAsyncApiYamlAsync(Microsoft.AspNetCore.Http.HttpRequest request, Microsoft.AspNetCore.Http.HttpResponse response, System.Threading.CancellationToken cancellationToken);
abstract member GetAsyncApiYamlAsync : Microsoft.AspNetCore.Http.HttpRequest * Microsoft.AspNetCore.Http.HttpResponse * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.GetAsyncApiYamlAsync : Microsoft.AspNetCore.Http.HttpRequest * Microsoft.AspNetCore.Http.HttpResponse * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function GetAsyncApiYamlAsync (request As HttpRequest, response As HttpResponse, cancellationToken As CancellationToken) As Task

Parameters

request
HttpRequest

The incoming HTTP request.

response
HttpResponse

The outgoing HTTP response.

cancellationToken
CancellationToken

A token to observe for cancellation.

Returns

A task representing the async operation.

Remarks

The path extension is authoritative for the returned content type — no Accept negotiation and no format conversion between the JSON and YAML representations. Override GetAsyncApiJsonAsync(HttpRequest, HttpResponse, CancellationToken) independently; publishing both is recommended for tooling compatibility.

When overriding, you MUST set StatusCode explicitly. This method returns 404 by default; once you override it the default no longer runs (unless the override calls base.GetAsyncApiJsonAsync(...) / base.GetAsyncApiYamlAsync(...)), so if you forget to set a status the response defaults to 200 with whatever body you wrote (or empty).

Applies to