Context
v3 adds write capability to the REST API. These endpoints are the backend for the Blazor management UI and are also directly usable by API clients.
All write endpoints require API key authentication (see #15).
Endpoints
| Method |
Path |
Description |
POST |
/api/v1/quotes |
Create a new quote |
PUT |
/api/v1/quotes/{id} |
Replace an existing quote |
DELETE |
/api/v1/quotes/{id} |
Delete a quote |
A PATCH endpoint (partial update) is out of scope for now — PUT replaces the full resource.
Input contract
POST and PUT accept a JSON body matching the quote schema. Required fields: quote, source, type. Optional: character, author, date, originalLanguage, genres, translations.
id is server-generated on POST (UUID v4). On PUT, the id in the path is authoritative; any id in the body is ignored.
Implementation checklist
Notes
- SQL injection prevention is mandatory: all user-supplied values must go through Dapper parameters, never string-formatted into SQL
originalLanguage defaults to "en" if omitted
genres defaults to [] if omitted
translations is optional and may be omitted or empty on initial creation
Context
v3 adds write capability to the REST API. These endpoints are the backend for the Blazor management UI and are also directly usable by API clients.
All write endpoints require API key authentication (see #15).
Endpoints
POST/api/v1/quotesPUT/api/v1/quotes/{id}DELETE/api/v1/quotes/{id}A
PATCHendpoint (partial update) is out of scope for now —PUTreplaces the full resource.Input contract
POSTandPUTaccept a JSON body matching the quote schema. Required fields:quote,source,type. Optional:character,author,date,originalLanguage,genres,translations.idis server-generated onPOST(UUID v4). OnPUT, theidin the path is authoritative; anyidin the body is ignored.Implementation checklist
IQuoteServicewithAddAsync,UpdateAsync,DeleteAsyncSqliteQuoteServiceusing parameterised queries (mandatory — no string concatenation)QuoteWriteRequestDTO with validation attributesQuoteEndpoints.cs(after/search, before/{id}to preserve route priority)201 CreatedwithLocationheader onPOST;200 OKonPUT;204 No ContentonDELETE404 Not FoundwhenPUTorDELETEtargets a non-existent id[Description]attributes for OpenAPI/Scalar documentationFakeQuoteServiceandWebApplicationFactoryREADME.md,addon/DOCS.md, andQuoteEndpoints.csdescriptions in the same commitNotes
originalLanguagedefaults to"en"if omittedgenresdefaults to[]if omittedtranslationsis optional and may be omitted or empty on initial creation