Skip to content

Conversation

raldred
Copy link
Contributor

@raldred raldred commented Jul 3, 2025

This fixes an issue where the schema node was not rendered when using allOf within an array items

eg.

  '200':
    description: List of resources
    content:
      application/vnd.api+json:
        schema:
          type: object
          properties:
            data:
              type: array
              items:
                allOf:
                  - type: object
                     properties:
                      one:
                        type: string
                  - type: object
                     properties:
                      two:
                        type: string

Description

This PR fixes an issue where the schema is not output correctly when allOf is used within an array items.

Motivation and Context

When using allOf in array items, it does not output/render the schema drill down.
All the attributes of the array are missing from the schema.
The example tab renders fine.

#1123

How Has This Been Tested?

I have run:

npm run build
npm run test

The schema is now rendered correctly, tested with a number of examples including with refs

Example
responses:
  '200':
    description: List of client accounts
    content:
      application/vnd.api+json:
        schema:
          $ref: '#/CollectionResponse'

CollectionResponse:
  type: object
  properties:
    data:
      type: array
      items:
        allOf:
          - type: object
            required:
              - id
            properties:
              id:
                type: string
          - $ref: '#/ClientAccountBase'

ClientAccountBase:
  type: object
  required:
    - type
    - attributes
  properties:
    type:
      allOf:
        - type: string
          enum:
            - client_accounts
    attributes:
      properties:
        name:
          type: string
          description: "The client name"
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true

Screenshots (if appropriate)

Before Change

Screenshot 2025-07-03 at 10 50 23

After Change

Screenshot 2025-07-03 at 11 25 47

Screenshot 2025-07-03 at 11 25 53

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

Copy link

github-actions bot commented Jul 3, 2025

Visit the preview URL for this PR (updated for commit 7ba974e):

https://docusaurus-openapi-36b86--pr1197-8jqwickq.web.app

(expires Sat, 02 Aug 2025 14:01:53 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

Copy link

github-actions bot commented Jul 3, 2025

Visual Diff Summary

View Logs

Total: 77, Matches: 77, Diffs: 0, Skipped: 0

Page Status

@sserrata sserrata added the bug Something isn't working label Jul 3, 2025
@sserrata sserrata self-assigned this Jul 3, 2025
@sserrata sserrata merged commit 85e7d73 into PaloAltoNetworks:main Jul 3, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants