Skip to content

Parser ignore readOnly/writeOnly on property with $ref #2036

@rongli-mx

Description

@rongli-mx

The Parser ignore the readOnly attribute on the property Order.customer

openapi: "3.0.1"
info:
  title: test
  version: "1.0"

paths:

  /ping:
    get:
      operationId: ping
      responses:
        200:
          description: OK
  /order:
    get:
      operationId: getOrder
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
    put:
      operationId: putOrder
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Order'
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                type: string

components:
  schemas:
    Customer:
      type: object
      properties: 
        id:
          type: string
        name:
          type: string
    Order:
      type: object
      properties:
        id:
          type: string
        operations:
          type: array
          items:
            $ref: '#/components/schemas/Operation'
          readOnly: true
        customer:
          $ref: '#/components/schemas/Customer'
#          readOnly: true # readOnly here will be ignored
    Operation:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          readOnly: true
        name:
          type: string
          writeOnly: true
          readOnly: false

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