kogosoftwarellc / open-api

A Monorepo of various packages to power OpenAPI in node
MIT License
892 stars 235 forks source link

[openapi-types] Property 'type' is missing in type '{ $ref: string; }' but required in type 'ItemsObject'. #746

Closed marikaner closed 3 years ago

marikaner commented 3 years ago

The error above occurs, when I have an array schema, like this (example from the official swagger docs):

schema: {
  type: 'array',
  items: {
    $ref: '#/definitions/pet'
  }
}

The typings now expect items to include a type although it is a reference, which should not be the case. This was not the case in version 8.0.0, but I couldn't find the change that caused this. I believe the SchemaObject type should define items?: ItemsObject | ReferenceObject; instead of items?: ItemsObject;.