-
Hi I Have the following schema export const frameSchema = z
.object({
frametype: z.literal('frame').optional().default('frame'),
name: z.string(),
type: z.string().optional(),
supertype: z.array(z.string()).optional(),
own_slot_value: z.array(z.object({
slot_reference: z.string(),
value: z.array(z.object({
value_type: z.string(),
value_content: z.string()
}))
})).optional(),
superclass: z.array(z.string()).optional(),
template_slot: z.array(z.string()).optional(),
template_facet_value: z.array(z.object({
slot_reference: z.string(),
facet_reference: z.string(),
value: z.array(z.object({
value_type: z.string(),
value_content: z.string()
}))
})).optional()
})
.strict(); And The following frontmatter declaration : ---
frametype: "class"
name: ":THING"
type: "STANDARD-CLASS"
supertype: ["CLASS", ":META-CLASS", ":SYSTEM-CLASS", ":THING"]
own_slot_value: [{slot_reference:":ROLE", value:[{value_type:"string", value_content: "Abstract"}]}]
--- And I am getting the following error Please help. own_slot_value is the cause. How to declare an array of objects containing array of objects ? Thank you in advance Best regards, Tshitshi PS {
"name": "docs",
"version": "0.0.7",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"test": "vitest",
"preview": "astro preview",
"check": "astro check",
"tsc": "astro sync && tsc",
"format": "pnpm run format:code",
"format:ci": "pnpm run format:imports && pnpm run format:code",
"format:code": "prettier -w . --cache --plugin-search-dir=.",
"format:imports": "organize-imports-cli ./tsconfig.json",
"add-language": "node ./scripts/add-language.mjs",
"docgen": "node ./scripts/docgen.mjs",
"docgen:errors": "node ./scripts/error-docgen.mjs",
"docgen:integrations": "tsm --require=./scripts/lib/filter-warnings.cjs ./scripts/generate-integration-pages.ts",
"lint:a11y": "start-test 'yarn build && yarn preview' 3000 'yarn lint:a11y:local'",
"lint:a11y:local": "pa11y-ci --sitemap 'http://localhost:3000/sitemap.xml' --sitemap-find 'https://docs.astro.build' --sitemap-replace 'http://localhost:3000'",
"lint:a11y:remote": "pa11y-ci --sitemap 'https://docs.astro.build/sitemap.xml'",
"lint:linkcheck": "SKIP_OG=true pnpm build && tsm --require=./scripts/lib/filter-warnings.cjs ./scripts/lint-linkcheck.ts",
"lint:linkcheck:nobuild": "tsm --require=./scripts/lib/filter-warnings.cjs ./scripts/lint-linkcheck.ts",
"lint:slugcheck": "node ./scripts/lint-slugcheck.mjs",
"lint:eslint": "eslint .",
"netlify:build": "pnpm ${NETLIFY_BUILD_SCRIPT:-build}",
"translation-status": "tsm --require=./scripts/lib/filter-warnings.cjs ./scripts/translation-status.ts"
},
"devDependencies": {
"@11ty/eleventy-fetch": "^3.0.0",
"@actions/core": "^1.9.0",
"@algolia/client-search": "^4.14.2",
"@astrojs/mdx": "^0.18.2",
"@astrojs/preact": "^2.0.3",
"@astrojs/sitemap": "1.0.1",
"@babel/core": "^7.18.10",
"@docsearch/css": "^3.2.2",
"@docsearch/react": "^3.2.0",
"@types/canvas-confetti": "^1.6.0",
"@types/chroma-js": "^2.1.4",
"@types/hast": "^2.3.4",
"@types/html-escaper": "^3.0.0",
"@types/mdast": "^3.0.10",
"@types/node": "^18.6.4",
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"astro": "^2.3.1",
"astro-auto-import": "^0.2.1",
"astro-eslint-parser": "^0.9.2",
"astro-og-canvas": "^0.1.7",
"bcp-47-normalize": "^2.1.0",
"canvaskit-wasm": "^0.37.0",
"chroma-js": "^2.4.2",
"dedent-js": "^1.0.1",
"domhandler": "^4.3.1",
"eslint": "^8.29.0",
"eslint-plugin-astro": "^0.21.0",
"eslint-plugin-react": "^7.32.1",
"fast-glob": "^3.2.11",
"hast-util-from-html": "^1.0.0",
"hast-util-to-html": "^8.0.4",
"hast-util-to-string": "^2.0.0",
"hastscript": "^7.0.2",
"html-escaper": "^3.0.3",
"htmlparser2": "^7.2.0",
"kleur": "^4.1.5",
"mdast-util-from-markdown": "^1.2.0",
"mdast-util-mdx-jsx": "^2.1.2",
"mdast-util-to-hast": "^12.2.4",
"mdast-util-to-string": "^3.1.1",
"micromark-util-character": "^1.1.0",
"micromark-util-symbol": "^1.0.1",
"node-fetch": "^3.2.10",
"organize-imports-cli": "^0.10.0",
"p-retry": "^5.1.1",
"parse-numeric-range": "^1.3.0",
"preact": "^10.10.1",
"prettier": "^2.8.1",
"prettier-plugin-astro": "^0.7.0",
"prompts": "^2.4.2",
"rehype": "^12.0.1",
"remark": "^14.0.2",
"remark-directive": "^2.0.1",
"simple-git": "^3.11.0",
"tsm": "^2.3.0",
"typescript": "^5.0.2",
"unified": "^10.1.2",
"unist-util-remove": "^3.1.0",
"unist-util-visit": "^4.1.0",
"unist-util-walker": "^1.0.0",
"vfile": "^5.3.6",
"vitest": "^0.28.5"
},
"dependencies": {
"@astrojs/alpinejs": "^0.2.1",
"@fontsource/ibm-plex-mono": "^4.5.10",
"@nanostores/preact": "^0.1.3",
"@types/alpinejs": "^3.7.1",
"alpinejs": "^3.12.0",
"canvas-confetti": "^1.6.0",
"jsdoc-api": "^7.1.1",
"nanostores": "^0.5.13",
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.0.1",
"remark-gfm": "^3.0.1",
"remark-smartypants": "^2.0.0",
"sass": "^1.54.3"
},
"engines": {
"node": ">=16.12.0",
"pnpm": ">=8.2.0"
},
"packageManager": "pnpm@8.2.0",
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"@types/react",
"react",
"react-dom",
"vite"
]
}
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ezzle! Couple things here:
By the way, we have a friendly Discord server if you’re looking for support in the future. We’d be happy to have you there! https://astro.build/chat |
Beta Was this translation helpful? Give feedback.
Hi @ezzle! Couple things here:
Looks like your schema says that
frametype
must beframe
, but in the frontmatter example it’s set toclass
, so that might be an issue.I think you maybe need to make sure there’s a space after each
:
in the object declarations ofown_slot_value
:By the way, we have a friendly Discord server if you’re looking for support in the future. We’d be happy to have you there! https://astro.build/chat