RapiDoc icon indicating copy to clipboard operation
RapiDoc copied to clipboard

Does schema field using oneOf support readOnly attribute?

Open AlaNDGT opened this issue 2 years ago • 0 comments

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:

image

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

AlaNDGT avatar Feb 14 '23 17:02 AlaNDGT