open-api icon indicating copy to clipboard operation
open-api copied to clipboard

TypeScript interface "ItemsObject" is missing "properties" property

Open doubliez opened this issue 4 years ago • 0 comments

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
}

doubliez avatar Jan 15 '21 00:01 doubliez