opensaber_api_spec.yaml 4.80 KiB
# API Spec for Open-Saber Registry Application
swagger: '2.0'
info:
  title: Open-Saber
  description: APIs for Open-saber registry
  version: "1.0.0"
# the domain of the service
host: io.open-saber
# array of all schemes that your API supports
schemes:
  - http
# will be prefixed to all paths
basePath: /
produces:
  - application/json
paths:
  /addEntity:
    post:
      summary: Add record
      description: |
        Add record endpoint adds a record of a defined type into the registry
        and returns response which includes whether the operation was successful
        or whether it was a failure and message indicating the reason for failure.
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
        - in: body
          name: requestObject
          description: Request body
          required: true
          schema:
            $ref: '#/definitions/Entity'
      responses:
        200:
          description: Status of the operation
          schema:
              $ref: '#/definitions/AddOpSuccessResponse'
  /getEntity:
    get:
      summary: Get record
      description: |
        Get record endpoint gets a record from the registry based on the unique identifier
        and returns the record in the response.
      produces:
      - application/json
      parameters:
        - in: query
          name: id
          description: Unique identifier for the record
          required: true
          type: string
      responses:
        200:
          description: id of the object created and the status of the operation
          schema:
              $ref: '#/definitions/GetOpSuccessResponse'
  /entity:
    patch:
      summary: Update record
      description: |
        Update record endpoint updates a record of a defined type into the registry
        and returns whether the operation was successful or unsuccessful as part of
        the response. Update record end point either updates the properties of the
        nodes under the root node or create child nodes if no id is provided.
      consumes:
      - application/json