List authorsv1.0.0 · JSON Schema
Returns all authors known to the Catalog.
1. Retrieve All Catalog Authors
The storefront filter sidebar or backoffice book form loads all registered authors (GET /api/v1/authors).
Payload details
- Response body: JSON array of
{ id, name }author objects.
Example response
[ { "id": "01960a1b-3000-7000-8a9b-0c1d2e3f4a03", "name": "Ursula K. Le Guin" }, { "id": "01960a1b-3000-7000-8a9b-0c1d2e3f4a04", "name": "Frank Herbert" }]Using this example
Returns 200 OK with the JSON array of Author records.
using BookWorm.Chassis.Utilities.Configurations;using BookWorm.Constants.Aspire;using Refit;
public interface ICatalogApiClient{ [Get("/api/v1/authors")] Task<IReadOnlyList<AuthorResponse>> ListAuthorsAsync( CancellationToken cancellationToken = default );}
public sealed record AuthorResponse(Guid Id, string? Name);
// DI registration following BookWorm.Chassis Refit patternbuilder.Services .AddRefitGeneratedClient<ICatalogApiClient>(settings, Services.Catalog) .ConfigureHttpClient(client => client.BaseAddress = new($"https+http://{Services.Catalog}")) .ConfigurePrimaryHttpMessageHandler(() => new SocketsHttpHandler { PooledConnectionLifetime = TimeSpan.FromMinutes(5) } );
// Typed invocationvar authors = await catalogApiClient.ListAuthorsAsync(cancellationToken);import authorsApiClient from "@workspace/api-client/catalog/authors";import useAuthors from "@workspace/api-hooks/catalog/authors/useAuthors";
// 1. Direct @workspace/api-client (Axios) callconst authors = await authorsApiClient.list();
// 2. React / TanStack Query hook (@workspace/api-hooks)const { data: authorList, isLoading } = useAuthors();1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "ListAuthorsResponse",
4 "description": "Collection of authors returned by the Catalog API.",
5 "type": "array",
6 "items": {
7 "type": "object",
8 "additionalProperties": false,
9 "required": ["id", "name"],
10 "properties": {
11 "id": {
12 "type": "string",
13 "format": "uuid",
14 "description": "A UUID identifying the resource."
15 },
16 "name": {
17 "type": ["string", "null"],
18 "description": "Author display name."
19 }
20 }
21 }
22}
23