Skip to content

Default value ignored on referenced objects #2819

@spous-ovl

Description

@spous-ovl

When an object as a default value overridden, it doesn't show in the doc.

Here a small snippet to show the problem:

Page is defined inline (Ok: default is shown in doc)
Quality1 is defined as a reference and the object has the default value inline (Ok: default is shown in doc)
Quality2 is defined as a reference and the object HAS NO default value, but the default value is documented in the referring object (NOT OK: default value NOT shown in doc)

description: A test Object
type: object
properties:
    page:
        type: integer
        default: 0
    quality1:
        $ref: '#/components/schemas/quality1'
    quality2:
        $ref: '#/components/schemas/quality2'
        default: "static"

Current Behavior

The default value doesn't appear in the stoplight even if the openapi.json with version 3.1 has the default value in the property of the object "quality":
openapi.json
"quality":{"$ref":"#/components/schemas/Quality","default":"static"}

Image

Expected Behavior

The default should appear as "static"
Image

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