Maybe we just shouldn't be trying to get that deep, perhaps we ignore items and let the singular handle it, but here's a fail case all the same.
components:
schemas:
BaseModel:
title: Base Model
type: object
properties:
type:
type: string
id:
type: string
format: uuid
attributes:
type: object
required:
- type
- id
- attributes
Foo:
type: array
items:
anyOf:
- $ref: '#/components/schemas/Branch'
# .. snip many more ..
Branch:
title: Branch
allOf:
- $ref: '#/components/schemas/BaseModel'
- type: object
properties:
type:
type: string
attributes:
type: object
properties:
name:
type: string
If anyone is struggling with this just turn it off:
extends:
- "spectral:oas"
- "@apisyouwonthate/spectral-jsonapi"
overrides:
- files:
- "openapi.yml#/components/schemas/Foo/items"
rules:
resource-object-id-required: "off"
Maybe we just shouldn't be trying to get that deep, perhaps we ignore items and let the singular handle it, but here's a fail case all the same.
If anyone is struggling with this just turn it off: