Skip to content

Built in rule: no-required-schema-properties-undefined - allOf composed schema with additional constraints in items #2062

@jeremyfiel

Description

@jeremyfiel

Describe the bug

related #2060 #2061

This is another test case for resolving allOf composed schemas with array items.

This schema uses an allOf to add the required constraint for 3 additional properties defined in the tasks array which originates in the workflowEnrollmentType > taskType_v01 schema.

properties:
  workflowEnrollment:
    allOf:
      - $ref: ./types/workflowEnrollmentType_v01.json
      - type: object
        properties:
          tasks:
            items:
              required:
                - taskName
                - taskTypeCode
                - taskGroup
# workflowEnrollmentType_v01.json
$schema: http://json-schema.org/draft-04/schema#
title: WorkflowEnrollmentType
description: Full representation of a workflow enrollment
type: object
allOf:
  - $ref: ./workflowEnrollmentBaseType_v01.json
  - type: object
    properties:
      tasks:
        description: Task details
        type: array
        items:
          $ref: ./taskType_v01.json
# taskType_v01.json
$schema: http://json-schema.org/draft-04/schema#
title: TaskType
description: Representation of a task
type: object
properties:
  taskID:
    description: ID of task
    $ref: ../../../../../common/simpleIDType_v01.json
  taskName:
    description: Name of task
    type: string
  taskDescription:
    description: Description of the task
    type: string
  taskTypeCode:
    description: Type of task
    $ref: ../../../../../common/simpleCodeType_v01.json
  taskGroup:
    description: The task group / objective to which the task belongs
    $ref: ./taskGroupType_v01.json
additionalProperties: false

To Reproduce
Steps to reproduce the behavior:

  1. Given this redocly.yaml file
  2. And this OpenAPI file(s)
  3. Run this command with these arguments... redocly ...
  4. See error

Expected behavior

Logs

OpenAPI description

Redocly Version(s)

Node.js Version(s)

OS, environment

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions