
get:
  operationId: getSchema
  tags:
    - Sources
  summary: Get Source Schema by ID
  description: |
    Get the Source Schema by ID in IdentityNow.
  parameters:
    - in: path
      name: sourceId
      required: true
      schema:
        type: string
      description: The Source id.
      example: 2c9180835d191a86015d28455b4a2329
    - in: path
      name: schemaId
      schema:
        type: string
      required: true
      description: The Schema id.
      example: 2c9180835d191a86015d28455b4a2329
  responses:
    '200':
      description: The requested Schema was successfully retrieved.
      content:
        application/json:
          schema:
            $ref: '../schemas/Schema.yaml'
    '400':
      $ref: '../../v3/responses/400.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
put:
  operationId: replaceSchema
  tags:
    - Sources
  summary: Update Source Schema (Full)
  description: |
    This API will completely replace an existing Schema with the submitted payload. Some fields of the Schema cannot be updated. These fields are listed below.

    * id
    * name
    * created
    * modified

    Any attempt to modify these fields will result in an error response with a status code of 400.

    > `id` must remain in the request body, but it cannot be changed.  If `id` is omitted from the request body, the result will be a 400 error.
  parameters:
    - in: path
      name: sourceId
      required: true
      schema:
        type: string
      description: The Source id.
      example: 2c9180835d191a86015d28455b4a2329
    - in: path
      name: schemaId
      schema:
        type: string
      required: true
      description: The Schema id.
      example: 2c9180835d191a86015d28455b4a2329
  requestBody:
    required: true
    content:
      application/json:
        schema:
          $ref: '../schemas/Schema.yaml'
  responses:
    '200':
      description: The Schema was successfully replaced.
      content:
        application/json:
          schema:
            $ref: '../schemas/Schema.yaml'
    '400':
      $ref: '../../v3/responses/400.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
patch:
  operationId: updateSchema
  tags:
    - Sources
  summary: Update Source Schema (Partial)
  description: >-
    This API can be used to selectively update an existing Schema using a JSONPatch payload. Some fields of the Schema cannot be updated. These fields are listed below.

    * id

    * name

    * created

    * modified
  parameters:
    - in: path
      name: sourceId
      required: true
      schema:
        type: string
      description: The Source id.
      example: 2c9180835d191a86015d28455b4a2329
    - in: path
      name: schemaId
      schema:
        type: string
      required: true
      description: The Schema id.
      example: 2c9180835d191a86015d28455b4a2329
  requestBody:
    required: true
    description: The JSONPatch payload used to update the schema.
    content:
      application/json-patch+json:
        schema:
          type: array
          items:
            $ref: '../schemas/JsonPatchOperation.yaml'
        examples:
          add-attribute:
            summary: Add an attribute to the end of the list
            value: [
                {
                    "op": "add",
                    "path": "/attributes/-",
                    "value": {
                        "name": "location",
                        "type": "STRING",
                        "schema": null,
                        "description": "Employee location",
                        "isMulti": false,
                        "isEntitlement": false,
                        "isGroup": false
                    }
                }
            ]
  responses:
    '200':
      description: The Schema was successfully updated.
      content:
        application/json:
          schema:
            $ref: '../schemas/Schema.yaml'
    '400':
      $ref: '../../v3/responses/400.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
delete:
  operationId: deleteSchema
  tags:
    - Sources
  summary: Delete Source Schema by ID
  parameters:
    - in: path
      name: sourceId
      required: true
      schema:
        type: string
      description: The Source id.
      example: 2c9180835d191a86015d28455b4a2329
    - in: path
      name: schemaId
      schema:
        type: string
      required: true
      description: The Schema id.
      example: 2c9180835d191a86015d28455b4a2329
  responses:
    '204':
      $ref: '../../v3/responses/204.yaml'
      description: The Schema was successfully deleted.
    '400':
      $ref: '../../v3/responses/400.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
