Skip to content

Commit d6a9aa8

Browse files
authored
fix(openapi): name inline enum schemas
1 parent 9bead83 commit d6a9aa8

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/app.contract.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { z } from '@scope/common/openapi';
22

33
export const HealthContract = z.object({
4-
status: z.enum(['healthy', 'unhealthy']),
4+
status: z.enum(['healthy', 'unhealthy']).openapi({
5+
title: 'HealthStatus',
6+
}),
57
uptime: z.number().openapi({ description: 'Uptime in milliseconds' }),
68
timestamp: z.string().openapi({ description: 'ISO 8601 timestamp' }),
79
}).openapi({

src/package/series/series.contract.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ const AnimeThemesSongContract = z.object({
6666

6767
export const AnimeThemesContract = z.object({
6868
id: z.number(),
69-
type: z.enum(['OP', 'ED']),
69+
type: z.enum(['OP', 'ED']).openapi({
70+
title: 'AnimeThemeType',
71+
description: 'Theme type classification (opening or ending)',
72+
}),
7073
sequence: z.number().nullable().optional(),
7174
slug: z.string(),
7275
animethemeentries: z.array(AnimeThemesEntryContract).default([]),
@@ -195,7 +198,10 @@ export const SeriesImageAttributesContract = z.object({
195198
height: z.number(),
196199
width: z.number(),
197200
url: z.string(),
198-
type: z.enum(['BACKDROP', 'POSTER', 'LOGO']),
201+
type: z.enum(['BACKDROP', 'POSTER', 'LOGO']).openapi({
202+
title: 'SeriesImageType',
203+
description: 'Image type classification (backdrop, poster, or logo)',
204+
}),
199205
}).openapi({
200206
title: 'SeriesImageAttributes',
201207
description: 'Image metadata including dimensions and type',

0 commit comments

Comments
 (0)