I have an OpenAPI 3.0 schema where one of the properties (the taskRequireSkills
array) needs to reference another schema (TaskRequireUserSkill
), like this:
components:
schemas:
Task:
properties:
id:
type: integer
name:
type: string
taskRequireSkills:
type: array
schema: # ERROR : bad indentation of a mapping entry
$ref: '#/components/schemas/TaskRequireUserSkill'
created_at:
type: string
format: datetime
TaskRequireUserSkill:
properties:
id:
type: integer
skill_id:
type: integer
skill_name:
type: string
ordering:
type: integer
created_at:
type: string
format: datetime
But I get the "bad indentation of a mapping entry" error. I suppose my syntax is invalid. But which syntax is valid?