-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
Parse Zod description as Markdown with YAML front matter: https://jekyllrb.com/docs/front-matter/
This is a well established system for including metadata inside a plain markdown string.
The front matter would be included in the openapi spec as metadata while the body would be used as the description. Some keys can trigger special behavior, for example injecting @deprecated into the generated types.
For example:
const routeSpec = {
methods: ["POST"],
auth: "auth_token",
jsonBody: z.object({
name: z.string().describe(`
---
deprecated: Use full_name
---
The name of the user.
`),
full_name: z.string().describe("The name of the user."),
}),
jsonResponse: z.object({
ok: z.boolean(),
}),
} as constReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels