open-api
open-api copied to clipboard
TypeScript interface "ItemsObject" is missing "properties" property
In my schema I have an array of objects that I define as:
{
type: 'array',
items: {
type: 'object',
properties: {...}
}
}
But this causes a TypeScript error. The value of "items" property uses the interface "ItemsObject" defined here: https://github.com/kogosoftwarellc/open-api/blob/25d0114680050efe3b4f9b7d0cca9f9e88057daa/packages/openapi-types/index.ts#L566-L585
This interface is missing "properties" as one of the allowed properties.
For now I'm getting around that by treating the object as "any" type:
{
type: 'array',
items: {
type: 'object',
properties: {...}
} as any
}