List publishersv1.0.0 · JSON Schema
Returns all publishers known to the Catalog.
1. Retrieve All Catalog Publishers
The storefront filter sidebar or backoffice book form loads all registered publishers (GET /api/v1/publishers).
Payload details
- Response body: JSON array of
{ id, name }publisher objects.
Example response
[ { "id": "01960a1b-2000-7000-8a9b-0c1d2e3f4a02", "name": "Ace Books" }, { "id": "01960a1b-2000-7000-8a9b-0c1d2e3f4a06", "name": "Gnome Press" }]Using this example
Returns 200 OK with the JSON array of Publisher records.
using BookWorm.Chassis.Utilities.Configurations;using BookWorm.Constants.Aspire;using Refit;
public interface ICatalogApiClient{ [Get("/api/v1/publishers")] Task<IReadOnlyList<PublisherResponse>> ListPublishersAsync( CancellationToken cancellationToken = default );}
public sealed record PublisherResponse(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 publishers = await catalogApiClient.ListPublishersAsync(cancellationToken);import publishersApiClient from "@workspace/api-client/catalog/publishers";import usePublishers from "@workspace/api-hooks/catalog/publishers/usePublishers";
// 1. Direct @workspace/api-client (Axios) callconst publishers = await publishersApiClient.list();
// 2. React / TanStack Query hook (@workspace/api-hooks)const { data: publisherList, isLoading } = usePublishers();1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "ListPublishersResponse",
4 "description": "Collection of publishers 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": "Publisher display name."
19 }
20 }
21 }
22}
23