diff --git a/wordpress/dto/WpPageDTO.ts b/wordpress/dto/WpPageDTO.ts index cb43bdf..1355753 100644 --- a/wordpress/dto/WpPageDTO.ts +++ b/wordpress/dto/WpPageDTO.ts @@ -4,7 +4,14 @@ import { explainWpPageStatus, isWpPageStatus, WpPageStatus } from "./WpPageStatu import { explainString, explainStringOrNull, isString, isStringOrNull } from "../../types/String"; import { explainRegularObject, isRegularObject } from "../../types/RegularObject"; import { explainNoOtherKeysInDevelopment, hasNoOtherKeysInDevelopment } from "../../types/OtherKeys"; -import { explainReadonlyJsonArray, explainReadonlyJsonObject, isReadonlyJsonArray, isReadonlyJsonObject, ReadonlyJsonArray, ReadonlyJsonObject } from "../../Json"; +import { + explainReadonlyJsonAny, + explainReadonlyJsonObject, + isReadonlyJsonAny, + isReadonlyJsonObject, + ReadonlyJsonArray, + ReadonlyJsonObject, +} from "../../Json"; import { explain, explainProperty } from "../../types/explain"; import { explainWpRenderedDTO, isWpRenderedDTO, WpRenderedDTO } from "./WpRenderedDTO"; import { explainNumber, isNumber } from "../../types/Number"; @@ -86,7 +93,7 @@ export function isWpPageDTO (value:any): value is WpPageDTO { && isString(value?.comment_status) && isString(value?.ping_status) && isNumber(value?.menu_order) - && isReadonlyJsonArray(value?.meta) + && isReadonlyJsonAny(value?.meta) && isString(value?.template) && isString(value?.link) && isString(value?.slug) @@ -139,7 +146,7 @@ export function explainWpPageDTO (value: any) : string { , explainProperty("comment_status", explainString(value?.comment_status)) , explainProperty("ping_status", explainString(value?.ping_status)) , explainProperty("menu_order", explainNumber(value?.menu_order)) - , explainProperty("meta", explainReadonlyJsonArray(value?.meta)) + , explainProperty("meta", explainReadonlyJsonAny(value?.meta)) , explainProperty("template", explainString(value?.template)) , explainProperty("link", explainString(value?.link)) , explainProperty("slug", explainString(value?.slug)) diff --git a/wordpress/dto/WpPostDTO.ts b/wordpress/dto/WpPostDTO.ts index f17fe3d..4b9649e 100644 --- a/wordpress/dto/WpPostDTO.ts +++ b/wordpress/dto/WpPostDTO.ts @@ -6,7 +6,14 @@ import { explainRegularObject, isRegularObject } from "../../types/RegularObject import { explainNoOtherKeysInDevelopment, hasNoOtherKeysInDevelopment } from "../../types/OtherKeys"; import { explainWpRenderedDTO, isWpRenderedDTO, WpRenderedDTO } from "./WpRenderedDTO"; import { explainNumber, isNumber } from "../../types/Number"; -import { explainReadonlyJsonArray, explainReadonlyJsonObject, isReadonlyJsonArray, isReadonlyJsonObject, ReadonlyJsonArray, ReadonlyJsonObject } from "../../Json"; +import { + explainReadonlyJsonAny, + explainReadonlyJsonObject, + isReadonlyJsonAny, + isReadonlyJsonObject, + ReadonlyJsonAny, + ReadonlyJsonObject, +} from "../../Json"; import { explain, explainProperty } from "../../types/explain"; import { explainBoolean, isBoolean } from "../../types/Boolean"; import { explainNumberArray, isNumberArray } from "../../types/NumberArray"; @@ -35,7 +42,7 @@ export interface WpPostDTO { * @fixme Add correct typing before using this property! * @deprecated (just so that IDE highlights and you read above comment) */ - readonly meta : ReadonlyJsonArray; + readonly meta : ReadonlyJsonAny; readonly template : string; readonly date_gmt : string | null; @@ -97,7 +104,7 @@ export function isWpPostDTO (value:any): value is WpPostDTO { && isString(value?.modified_gmt) && isString(value?.link) && isString(value?.ping_status) - && isReadonlyJsonArray(value?.meta) + && isReadonlyJsonAny(value?.meta) && isString(value?.template) && isStringOrNull(value?.date_gmt) && isString(value?.format) @@ -154,7 +161,7 @@ export function explainWpPostDTO (value: any) : string { , explainProperty("featured_media", explainNumber(value?.featured_media)) , explainProperty("comment_status", explainString(value?.comment_status)) , explainProperty("ping_status", explainString(value?.ping_status)) - , explainProperty("meta", explainReadonlyJsonArray(value?.meta)) + , explainProperty("meta", explainReadonlyJsonAny(value?.meta)) , explainProperty("template", explainString(value?.template)) , explainProperty("date_gmt", explainStringOrNull(value?.date_gmt)) , explainProperty("format", explainString(value?.format))