swagger-parser
swagger-parser copied to clipboard
Parser ignore readOnly/writeOnly on property with $ref
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