RapiDoc
RapiDoc copied to clipboard
Does schema field using oneOf support readOnly attribute?
Does schema field using oneOf support readOnly attribute same as allOf?
oneOf fields are displayed on PUT|POST|PATCH but allOf are hidden as shown bellow:
Example OAS:
openapi: 3.1.0
info:
title: test
version: '1.0'
servers:
- url: 'http://localhost:3000'
paths:
/test:
parameters: []
put:
summary: test
operationId: put-test
responses:
'200':
description: OK
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
description: update
get:
summary: Get
operationId: get-test
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
description: get
components:
schemas:
Pet:
title: Pet
type: object
properties:
id:
type: string
name:
type: string
testAllOf:
allOf:
- type: object
properties:
foo:
type: string
- type: string
readOnly: true
testOneOf:
oneOf:
- type: object
properties:
foo:
type: string
- type: string
- type: 'null'
readOnly: true