Fix swagger examples for externalId

This commit is contained in:
Zoe Roux 2025-03-03 11:45:41 +01:00
parent bf16231350
commit 2aada33a6a
No known key found for this signature in database
7 changed files with 7 additions and 8 deletions

View File

@ -36,7 +36,7 @@ const BaseCollection = t.Object({
nextRefresh: t.String({ format: "date-time" }), nextRefresh: t.String({ format: "date-time" }),
externalId: ExternalId, externalId: ExternalId(),
}); });
export const CollectionTranslation = t.Object({ export const CollectionTranslation = t.Object({

View File

@ -19,7 +19,7 @@ export const BaseMovieEntry = t.Intersect(
minimum: 1, minimum: 1,
description: "Absolute playback order. Can be mixed with episodes.", description: "Absolute playback order. Can be mixed with episodes.",
}), }),
externalId: ExternalId, externalId: ExternalId(),
}), }),
BaseEntry(), BaseEntry(),
], ],

View File

@ -255,7 +255,7 @@ export const madeInAbyss = {
externalId: { externalId: {
themoviedatabase: { themoviedatabase: {
dataId: "16738", dataId: "16738",
link: "https://www.themoviedb.org/company/16738/movie", link: "https://www.themoviedb.org/company/16738",
}, },
}, },
}, },

View File

@ -36,7 +36,7 @@ const BaseMovie = t.Object({
nextRefresh: t.String({ format: "date-time" }), nextRefresh: t.String({ format: "date-time" }),
externalId: ExternalId, externalId: ExternalId(),
}); });
export const MovieTranslation = t.Object({ export const MovieTranslation = t.Object({

View File

@ -46,7 +46,7 @@ const BaseSerie = t.Object({
nextRefresh: t.String({ format: "date-time" }), nextRefresh: t.String({ format: "date-time" }),
externalId: ExternalId, externalId: ExternalId(),
}); });
export const SerieTranslation = t.Object({ export const SerieTranslation = t.Object({

View File

@ -5,7 +5,7 @@ import { DbMetadata, ExternalId, Resource, TranslationRecord } from "./utils";
import { Image, SeedImage } from "./utils/image"; import { Image, SeedImage } from "./utils/image";
const BaseStudio = t.Object({ const BaseStudio = t.Object({
externalId: ExternalId, externalId: ExternalId(),
}); });
export const StudioTranslation = t.Object({ export const StudioTranslation = t.Object({

View File

@ -1,14 +1,13 @@
import { t } from "elysia"; import { t } from "elysia";
import { comment } from "../../utils"; import { comment } from "../../utils";
export const ExternalId = t.Record( export const ExternalId = () => t.Record(
t.String(), t.String(),
t.Object({ t.Object({
dataId: t.String(), dataId: t.String(),
link: t.Nullable(t.String({ format: "uri" })), link: t.Nullable(t.String({ format: "uri" })),
}), }),
); );
export type ExternalId = typeof ExternalId.static;
export const EpisodeId = t.Record( export const EpisodeId = t.Record(
t.String(), t.String(),