openapi: 3.0.0
info:
  title: Hidden readOnly
  version: 1.0.0
  description: Hidden readOnly/writeOnly properties for write/read actions.
components:
  schemas:
    dummy:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
        password:
          type: string
          writeOnly: true
  requestBodies:
    request:
      description: Check out the model tab to see (or not see) the readOnly property `id`
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/dummy'
  responses:
    response:
      description: >-
        Check out the model tab to see (or not see) the writeOnly property
        `password`
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/dummy'
paths:
  /user:
    get:
      summary: 1. Get
      description: >-
        Note: although uncommon, and it's an odd example here, but a GET request
        could also have a request body
      requestBody:
        $ref: '#/components/requestBodies/request'
      responses:
        '200':
          $ref: '#/components/responses/response'
    post:
      summary: 2. Post
      requestBody:
        $ref: '#/components/requestBodies/request'
      responses:
        '200':
          $ref: '#/components/responses/response'
    put:
      summary: 3. Put
      requestBody:
        $ref: '#/components/requestBodies/request'
      responses:
        '200':
          $ref: '#/components/responses/response'
    patch:
      summary: 4. Patch
      requestBody:
        $ref: '#/components/requestBodies/request'
      responses:
        '200':
          $ref: '#/components/responses/response'
    delete:
      summary: 5. Delete
      responses:
        '200':
          $ref: '#/components/responses/response'
    options:
      summary: 6. Options
      responses:
        '200':
          $ref: '#/components/responses/response'
