// Compile-time contract test for the action OpenAPI overrides (#40): an action // meta carries the same meta.openapi block a collection uses. const meta: ActionMeta = { label: { de: "Kontaktformular", en: "Contact Form" }, openapi: { disabled: false, get: { summary: { de: "Formular abrufen", en: "Get the form" }, parameters: [ { name: "lang", in: "query", required: false, schema: { type: "string" }, }, ], responses: { "200": { description: "OK" } }, security: [{ "X-Api-Token": [] }], }, post: { summary: { de: "Formular senden", en: "Submit the form" }, }, }, } const info: ActionInfo = { name: "contact-form", meta, permissions: { public: { methods: { post: { allow: true } } }, }, } type _MetaIsOpenapi = Expect["openapi"], OpenapiMeta | undefined>> type _SummaryIsLocalized = Expect["summary"], LocalizedText | undefined>> const disabled: boolean | undefined = meta.openapi?.post?.disabled type _DisabledIsBoolean = Expect> // @ts-expect-error `in` is limited to the OpenAPI parameter locations const badParameter: OpenapiParameter = { name: "lang", in: "body" } declare const expectTrue: Expect void expectTrue void info void badParameter