Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Swagger open api macro
swagger: "2.0"
info:
  version: "0.0.1"
  title: ARES Kudo API server
# during dev, should point to your local machine
host: localhost:3000
# basePath prefixes all resource paths

basePath: /api
#

tags:
  - name: ARES Kudo Required
    description: Required APIs to load and store a drawing
  - name: ARES Kudo Optional
    description: Optional APIs to improve interactions for loading and storing a drawing
  - name: File Sessions
    description: Optional File Session Handling
  - name: Commenting
    description: API support for commenting panel
  - name: User Sessions
    description: Optional User Session Handling
  - name: Block Library
    description: API support for Block Library

schemes:
  # tip: remove http to make production-grade
  - http
  - https
# format of bodies a client can send (Content-Type)
consumes:
  - application/json
# format of the responses to the client (Accepts)
produces:
  - application/json
parameters:
  fileId:
    name: fileId
    in: path
    description: The id of the file
    required: true
    type: string
  sessionIdlibId:
    name: sessionidlibId
    in: headerpath
    description: The id of the user sessionIdlibrary
    required: true
    type: string
  threadIditemId:
    name: threadIditemId
    in: path
    description: The id of the comment threadblock
    required: true
    type: string
  markupIdownerType:
    name: markupIdownerType
    in: pathheader
    description: Type of the markuplibrary (PUBLIC/USER/ORG)
    required: truefalse
    type: string
  commentIdsessionId:
    name: commentIdsessionid
    in: pathheader
    description: the commentuser sessionId
    required: true
    type: string
  attachmentIdthreadId:
    name: attachmentIdthreadId
    in: path
    description: the attachmentcomment thread
    required: true
    type: string
  optionalSessionIdmarkupId:
    name: sessionidmarkupId
    in: headerpath
    description: the usermarkup
sessionId     required: falsetrue
    type: string
paths:   /files/{fileId}/diffscommentId:
    parametersname: commentId
    in: -path
  $ref: '#/parameters/fileId'
   description: the comment
   - $refrequired: '#/parameters/optionalSessionId' true
    type: # binds a127 app logic to a routestring
  attachmentId:
    name: attachmentId
    x-swagger-router-controllerin: filespath
     getdescription: the attachment
    descriptionrequired: Returnstrue
file content   type: string
  #optionalSessionId:
used as the method name: ofsessionid
  the controller in: header
    operationIddescription: diffs_getthe user sessionId
    tagsrequired: false
    type: string
paths:
- ARES Kudo Required /library/blocks:
      responsesparameters:
      - $ref: "200#/parameters/optionalSessionId":
      - $ref: "#/parameters/ownerType"

description: Success   x-swagger-router-controller: blocks

     schemaget:
      description: Returns block libraries

 required:     operationId: libraries_get
      tags:
 - status      - Block Library
      -responses:
baseContent        "200":
    properties:      description: Success
          statusschema:
            $ref: "#/definitions/LibrariesResponse"
   type: string    default:
          description: Error
default: "ok"         schema:
     baseContent:       $ref: "#/definitions/ErrorResponse"

  /library/blocks/{libId}/items:
    typeparameters:
string      - $ref: "#/parameters/libId"
      -  description$ref: Base64 encoded content of file
  "#/parameters/optionalSessionId"

    x-swagger-router-controller: blocks

    get:
      description: #Returns responsesblocks mayof falla throughlibrary
to
errors      operationId: blocks_get
 "404":     tags:
     description: Error  - Block Library
      schemaresponses:
        "200":
    $ref: "#/definitions/ErrorResponse"     putdescription: Success
     description: Update file content  schema:
    # used as the method name of the controller
 $ref: "#/definitions/BlocksResponse"
    operationId: diffs_put   default:
   tags:       description: Error
- ARES Kudo Required       parametersschema:
        - name: body  $ref: "#/definitions/ErrorResponse"

  /library/blocks/{libId}/items/{itemId}/content:
   in parameters:
body      - $ref: "#/parameters/libId"
  required: true   - $ref: "#/parameters/itemId"
     schema: - $ref: "#/parameters/optionalSessionId"
      - in:  required:query
        name: fileType
    - baseContent   required: false
        propertiesdefault: "dwg"
        type: string

   baseContent x-swagger-router-controller: blocks

    get:
      description: Returns  type: stringblock file

      operationId: block_getfile
      tags:
        - description:Block Base64Library
encoded content of file   produces:
        - application/octet-stream
      responses:
        "200":
          description: Success
        default:
 schema:         description: Error
  required:        schema:
      - status     $ref: "#/definitions/ErrorResponse"

  /library/blocks/{libId}/items/{itemId}/thumbnail:
    -parameters:
changeId      - $ref: "#/parameters/libId"
    properties:  - $ref: "#/parameters/itemId"
      - $ref: "#/parameters/optionalSessionId"
 status:     - in: query
        name: fileType
type: string       required: false
        default: "okpng"
        type: string

    changeId:
x-swagger-router-controller: blocks

    get:
      description: Returns block thumbnail

      operationId: block_getthumbnail
      tags:
        type: string- Block Library
      produces:
        - application/octet-stream
   #   responses may fall through to errors:
        "200":
          description: Success
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"

  /files:
    parameters:
      - $ref: '"#/parameters/optionalSessionId'"
    x-swagger-router-controller: files
    post:
      description: Create/Update a file
      # used as the method name of the controller
      operationId: post_file
      tags:
        - ARES Kudo Required
      consumes:
         - multipart/form-data
      parameters:
        - in: header
          name: fileId
          description: ID of the file (New file will be created if this value is not specified)
          required: false
          type: string
        - in: formData
          name: file
          required: true
          type: file
      responses:
        "200":
          description: Success
          schema:
            required:
              - id
              - filename
              - isNewFile
              - changeId
            properties:
              id:
                 type: string
              filename:
                type: string
              isNewFile:
                type: boolean
              changeId:
                type: string
        # responses may fall through to errors
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
  /files/{fileId}/data:
    parameters:
      - $ref: '"#/parameters/fileId'"
      - $ref: '"#/parameters/optionalSessionId'"
    # binds a127 app logic to a route
    x-swagger-router-controller: files

    get:
      description: Returns file content
      # used as the method name of the controller
      operationId: data_get
      tags:
        - ARES Kudo Required
      produces:
        - application/octet-stream
      responses:
        "200":
          description: Success
        # responses may fall through to errors
        "404":
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"


   /files/{fileId}/xref/search:
    # binds a127 app logic to a route
    x-swagger-router-controller: files
    post:
      description: XRef search
      # used as the method name of the controller
      operationId: xref_search
      tags:
        - ARES Kudo Optional
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/optionalSessionId'"
        - name: body
          in: body
          required: true
          schema:
            required:
              - path
            properties:
              path:
                type: array
                description: xrefs paths to search         
                   items:
                   type: string
      responses:
        "200":
          description: Success
          schema:
            type: array
            items:
              type: object
              properties:
                path:
                   type: string
                files:
                  type: array
                  items:
                    type: object
                    properties:
                      "_id":
                        type: string
        # responses may fall through to errors
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
  /files/{fileId}/preview:
    # binds a127 app logic to a route
    x-swagger-router-controller: files
    post:
      description: Optionally handle receiving updates previews
      # used as the method name of the controller
      operationId: preview_post
      tags:
        - ARES Kudo Optional
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/optionalSessionId'"
        - in: formData
          name: file
          required: true
          type: file
      responses:
        "200":
          description: Success
          schema:
            type: object
            properties:
              status: 
                type: string
                default: "ok"
        # responses may fall through to errors
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"

                       
  /files/{fileId}/info:
    # binds a127 app logic to a route
    x-swagger-router-controller: files
    get:
      description: Returns file information
      # used as the method name of the controller
      operationId: info_get
      tags:
        - ARES Kudo Required
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/optionalSessionId'"
      responses:
        "200":
          description: Success
          schema:
            required:
              - status
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              filename:
                 type: string
              folderId:
                 type: string
              owner: 
                type: string
        # responses may fall through to errors
        "401":
          description: User is not autenticated
          schema:
            $ref: "#/definitions/ErrorResponse"
        "404":
          description: File is not found
          schema:
            $ref: "#/definitions/ErrorResponse"
  /files/{fileId}/session:
    # binds a127 app logic to a route
    parameters:
      - $ref: '"#/parameters/fileId'"
      - $ref: '"#/parameters/sessionId'"

    x-swagger-router-controller: files_sessions
    get:
      description: get file sessions
      # used as the method name of the controller
      operationId: session_get
      tags:
        - File Sessions
      responses:
        "200":
          description: Success
          schema:
            # a pointer to a definition
            $ref: "#/definitions/SessionsResponse"
        # responses may fall through to errors
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
    post:
      description: Create file session. Sessions need to be either of type "view" or "edit"
      # used as the method name of the controller
      operationId: session_post
      tags:
        - File Sessions
      parameters:
        - name: body
          in: body
          required: true
          schema:
            required:
              - mode
            properties:
              mode:
                type: string
                description: Type of session requested
                   enum: [view, edit]
              fileId:
                type: string
                description: fileId for the file for which the session is being requested  
        responses:
        "200":
          description: Success
          schema:
            required:
              - status
              - "_id"
            properties:
              status:
                 type: string
                default: "ok"
              "_id":
                type: string
        # responses may fall through to errors
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
    delete:
      description: delete file session
      # used as the method name of the controller
      operationId: session_delete
      parameters:
        - name: body
          in: body
          required: true
          schema:
            required:
              - mode
            properties:
              mode:
                type: string
                description: Type of session requested
                   enum: [view, edit]
      tags:
        - File Sessions
      responses:
        "200":
          description: Success
          schema:
            # a pointer to a definition
            $ref: "#/definitions/SessionsResponse"
        # responses may fall through to errors
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
  /auth:
    # binds a127 app logic to a route
    x-swagger-router-controller: auth
    get:
      description: validate user session
      # used as the method name of the controller
      tags:
        - User Sessions
      operationId: auth_get
      parameters:
        - $ref: '"#/parameters/optionalSessionId'"
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status: 
                type: string
                default: "ok"
        401:
          description: Authorization information is missing or invalid.
  /users:
    # binds a127 app logic to a route
    x-swagger-router-controller: users
    get:
      description: Returns user object
      # used as the method name of the controller
      operationId: users_get
      tags:
        - User Sessions
      parameters:
        - $ref: '"#/parameters/sessionId'"
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              results:
                type: array
                items: 

                   type: object
                    properties:
                      fname:
 
                      type: string
                        description: first name
                      surname:
                        type: string
                        description: last name of user
                      "_id":
 
                      type: string
                      email:
                        type: string
                      licenseExpirationDate:
                        type: integer
 
                    preferences:

                       type: object
                        properties:
                          preferences_display:
 
                          type: object
                            properties:
                               graphicswinmodelbackgrndcolor:
                                type: string
 
                              default: White
 
                        view:
                            type: object
                          window:
                            type: object
 
                        variables:

                           type: object
                            properties:
                               dynasnap:
 
                              type: string

                               default: "63"
    put:
      description: Returns user object
      # used as the method name of the controller
      operationId: users_put
      tags:
        - User Sessions
      parameters:
        - $ref: '"#/parameters/sessionId'"
        - name: body
          in: body
          required: true
          schema:
            properties:
              preferences:
                type: object
                description: user preferences
                properties:
                  window:
                    type: object
                    properties:
                      edit:
                        type: object
                        properties:
                          dockwidgets:
                            type: object
                            properties:
                              layerwindow:
                                type: object
                                properties:
                                  h:
                                    type: string
                                    description: height o the layerwindow

      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status: 
                type: string
                default: "ok"
  /v1/files/{fileId}/annotations:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    get:
      description: Returns annotations for a file
      # used as the method name of the controller
      operationId: annotations_get
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - name: timestamp
          type: integer
          in: query
          required: false
          description: timestamp of last request to only send new items
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              results:
                type: object
                properties:
                  timestamp:
                    type: integer
                    description: time of response
                  commmentThreads:
                    type: array
                    description: ""
                    items:
                      type: object
                  markups:
                    type: array
                    description: ""
                    items:
                      type: object
                  status:
                    type: string
                    default: "ok"
  /v1/files/{fileId}/markups:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    get:
      description: Returns markups for a file
      # used as the method name of the controller
      operationId: markups_get
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - name: timestamp
          type: integer
          in: query
          required: false
          description: timestamp of last request to only send new items
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              results:
                type: object
                properties:
                  timestamp:
                    type: integer
                    description: time of response
                  markups:
                    type: array
                    description: ""
                    items:
                      type: object
                  status:
                    type: string
                    default: "ok"
  /v1/files/{fileId}/commentThreads:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    get:
      description: Returns comments for a file
      # used as the method name of the controller
      operationId: commentThreads_get
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - name: timestamp
          type: integer
          in: query
          required: false
          description: timestamp of last request to only send new items
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              results:
                type: object
                properties:
                  timestamp:
                    type: integer
                    description: time of response
                  commmentThreads:
                    type: array
                    description: ""
                    items:
                      type: object
                  status:
                    type: string
                    default: "ok"
  /v1/files/{fileId}/commentThread:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    post:
      description: Add a new commentThread for a file
      # used as the method name of the controller
      operationId: commentThread_post
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - name: body
          in: body
          required: true
          schema:
             type: object
            properties:
              title:
                type: string
              text:
                type: string
              state:
                type: string
                enum: [ACTIVE, RESOLVED]
              ids:
                type: array
                items:
                  type: string
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status: 
                type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
  /v1/files/{fileId}/commentThread/{threadId}:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    put:
      description: Update a commentThread 
      # used as the method name of the controller
      operationId: commentThread_put
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/threadId'"
        - name: body
          in: body
          required: true
          schema:
             type: object
            properties:
              title:
                type: string
              text:
                type: string
              ids:
                type: array
                items:
                  type: string
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
    get:
      description: get a commentThread
       # used as the method name of the controller
      operationId: commentThread_get
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/threadId'"
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status: 
                type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response 
    delete:
      description: Delete a comment Thread 
      # used as the method name of the controller
      operationId: commentThread_delete
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/threadId'"
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status: 
                type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response 
  /v1/files/{fileId}/commentThread/{threadId}/comment/{commentId}:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    put:
      description: Update a comment
       # used as the method name of the controller
      operationId: comment_put
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/threadId'"
        - $ref: '"#/parameters/commentId'"
        - name: body
          in: body
          required: true
          schema:
             type: object
            properties:
              text:
                type: string
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
    get:
      description: Retrieve a comment 
      # used as the method name of the controller
      operationId: comment_get
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/threadId'"
        - $ref: '"#/parameters/commentId'"
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
    delete:
      description: Delete a comment 
      # used as the method name of the controller
      operationId: comment_delete
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/threadId'"
        - $ref: '"#/parameters/commentId'"
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
  /v1/files/{fileId}/commentThread/{threadId}/comment:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    post:
      description: Post a new comment 
      # used as the method name of the controller
      operationId: comment_post
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/threadId'"
        - name: body
          in: body
          required: true
          schema:
             type: object
            properties:
              text:
                type: string
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
  /v1/files/{fileId}/markup:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    post:
      description: Add a new markup for a file
      # used as the method name of the controller
      operationId: markup_post
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - name: body
          in: body
          required: true
          schema:
             type: object
            properties:
              title:
                type: string
              text:
                type: string
              state:
                type: string
                enum: [ACTIVE, RESOLVED]
              ids:
                type: array
                items:
                  type: string
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
  /v1/files/{fileId}/markup/{markupId}:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    put:
      description: Update a markup
       # used as the method name of the controller
      operationId: markup_put
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/markupId'"
        - name: body
          in: body
          required: true
          schema: 
            type: object
            properties:
              title:
                type: string
              text:
                type: string
              ids:
                type: array
                items:
                  type: string
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status: 
                type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
    get:
      description: get a markup 
      # used as the method name of the controller
      operationId: markup_get
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/markupId'"
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status: 
                type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response 
     delete:
      description: delete a markup
       # used as the method name of the controller
      operationId: markup_delete
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/markupId'"
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
    /v1/files/{fileId}/markup/{markupId}/comment/{commentId}:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    put:
      description: Update a comment
       # used as the method name of the controller
      operationId: markupcomment_put
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/markupId'"
        - $ref: '"#/parameters/commentId'"
        - name: body
          in: body
          required: true
          schema:
             type: object
            properties:
              text:
                type: string
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status: 
                type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
    get:
      description: Retrieve a markup comment 
      # used as the method name of the controller
      operationId: markupcomment_get
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/markupId'"
        - $ref: '"#/parameters/commentId'"
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
    delete:
      description: Delete a markup comment
       # used as the method name of the controller
      operationId: markupcomment_delete
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/markupId'"
        - $ref: '"#/parameters/commentId'"
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
  /v1/files/{fileId}/markup/{markupId}/comment:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    post:
      description: Post a new markup comment
       # used as the method name of the controller
      operationId: markupcomment_post
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: '"#/parameters/markupId'"
        - name: body
          in: body
          required: true
          schema: 
            type: object
            properties:
              text:
                type: string
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status: 
                type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
  /v1/files/{fileId}/attachment:
    x-swagger-router-controller: comments
    post:
      description: Create a markup attachment
      # used as the method name of the controller
      operationId: attachment_post
      tags:
        - Commenting
      consumes:
         - multipart/form-data
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - in: formData
          name: attachment
          required: true
          type: file
      responses:
        "200":
          description: Success
          schema:
            required:
              - status
              - changeId
            properties:
              status:
                type: string
                default: "ok"
              changeId:
                type: string
        # responses may fall through to errors
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
  /v1/files/{fileId}/attachments:
    x-swagger-router-controller: comments
    get:
      description: Retrieve all attachments
      # used as the method name of the controller
      operationId: attachments_get
       nametags:
attachment        - Commenting
 required: true    parameters:
      type: file - $ref: "#/parameters/fileId"
   responses:     - $ref:   "200":"#/parameters/sessionId"
      responses:
   description: Success    # responses may fall through to errors
schema:        "200":
    required:      description: Success
       - status  schema:
            -type: changeIdobject
            properties:
              status:
                 type: string
                default: "ok"
              changeIdtimestamp:
                type: stringinteger
        # responses may fall through to errors         default:
          description: Errortime of response
        schema/v1/files/{fileId}/attachments/{attachmentId}:
    # binds a127 app     $ref: "#/definitions/ErrorResponse"
  /v1/files/{fileId}/attachments:logic to a route
    x-swagger-router-controller: comments
    get:
      description: Retrieve allattachment
attachments 
      # used as the method name of the controller
      operationId: attachmentsattachment_get
      tags:
        - Commenting
      parameters:
        - $ref: '"#/parameters/fileId'"
        - $ref: '"#/parameters/sessionId'"
        - $ref: "#/parameters/attachmentId"
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status:
                 type: string
                default: "ok"
              timestamp:
                type: integer
                description: time of response
  /v1/files/{fileId}/attachments/{attachmentId}:swagger:
    x-swagger-pipe: swagger_raw
# binds a127 app logic to a route complex objects have schema definitions
definitions:
  SessionsResponse:
    required:
      - status
      - results
    properties:
      status:
        type: string
        x-swagger-router-controllerdefault: comments"ok"
    get:  results:
    description: Retrieve attachment  type: array
    # used as the methoditems:
name of the controller       operationIdtype: attachment_getobject
      tags:    properties:
    - Commenting       parametersmode:
        - $ref: '#/parameters/fileId'    type: string
   - $ref: '#/parameters/sessionId'         - $ref: '#/parameters/attachmentId'enum: [view, edit]
      responses:      username:
  # responses may fall through to errors      type: string
 "200":           descriptionsessionId:
Success              schematype: string
            typeuserId:
object              propertiestype: string

  LibrariesResponse:
    required:
      - status:
      - results
    properties:
     type status:
 string       type: string
        default: "ok"
      results:
        timestamptype: array
               typeitems:
integer          type: object
     description: time of response   /swaggerproperties:
    x-swagger-pipe: swagger_raw # complex objects have schema definitions definitionsid:
  SessionsResponse:     required:       -type: statusstring
      - results     propertiesname:
 
    status:          type: string
  BlocksResponse:
    required:
default: "ok"     - status
results:      - results
 type: array  properties:
      itemsstatus:
        type: string
   type: object    default: "ok"
       propertiesresults:
        type: array
    mode:     items:
           type: stringobject
                enumproperties:
[view, edit]               usernameid:
                type: string
              sessionIdname:

               type: string
              userIdthumbnail:
 
              type: string

  ErrorResponse:
    required:
      - message
    properties:
      message:
        type: string
      errrorId:
        type: string