Skip to content

asterisk is not shown for inherited nested required properties #7618

@lipnitsk

Description

@lipnitsk

Q&A

  • OS: Any
  • Browser: Any
  • Swagger-UI version: 4.0.1
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.0.3
info:
  version: 1.0.0
  title: test
  description: test
  contact:
    name: test
    email: test@example.com
servers:
  - url: 'https://localhost/api'
tags:
  - name: Test
    description: Test
paths:
  /one:
    get:
      description: test
      operationId: one
      tags:
        - Test
      parameters:
        - name: test
          in: header
          required: true
          schema:
            type: string
      responses:
        'default':
          description: Response
          content:
            text/plain:
              schema:
                type: integer
                enum: [ 401, 404, 500 ]

components:
  schemas:
    parent:
      type: object
      required:
        - required1
      properties:
        required1:
          type: string
        nested1:
          type: object
          required:
            - nestedrequired1
          properties:
            nestedrequired1:
              type: string

    child:
      allOf:
        - $ref: '#/components/schemas/parent'
        - type: object
          required:
            - required2
          properties:
            required2:
              type: string
            nested1:
              type: object
              required:
                - nestedrequired2
              properties:
                nestedrequired2:
                  type: string

Swagger-UI configuration options: Default.

Describe the bug you're encountering

To reproduce...

Steps to reproduce the behavior:

  1. Open the above YAML in https://editor.swagger.io/
  2. Expand "Schemas"
  3. Notice missing * next to nestedrequired1 under child

Expected behavior

nestedrequired1 is marked with *, just like required1, under child

Screenshots

image

Additional context or thoughts

Is this a swagger-ui or a swagger-js bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions