Skip to content

Referring object tamper other objects through referenced one #2419

@vZ2JEZsZW

Description

@vZ2JEZsZW

description and examples of referring objects discarded in favor of values spreading from other objects referring same target.

Steps to Reproduce:

# file2.yaml
referenced: { type: string }
object:
    allOf:
        -   type: object
            properties:
                AAAAA:
                    $ref: '#/referenced'
                    description: AAAAA
                    examples: [AAAAA]
                BBBBB:
                    $ref: '#/referenced'
                    description: BBBBB
                    examples: [BBBBB]
# file1.yaml
paths:
    /operation:
        post:
            summary: operation
            requestBody:
                required: true
                content:
                    application/json:
                        schema: {$ref: 'file2.yaml#/object'}
            operationId: operationId
            security: [ ]
servers: [ url: 'http://example.com' ]
openapi: 3.1.0
info:
    title: Test
    version: version

Resulting documentation: BBBBB gets irrelevant description and examples from AAAAA
stoplight

Version used: 7.13.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions