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
(has to be implemented if sessionId query parameter is passed to editor url)
  - name: Commenting
    description: API support for commenting panel
  - name: User Sessions
    description: Optional User Session Handling (has to be implemented if sessionId query parameter is passed to editor url)
    
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
  sessionId:
    name: sessionIdsessionid
    in: header
    description: the user sessionId
    required: true
    type: string
  threadId:
    name: threadId
    in: path
    description: the comment thread
    required: true
    type: string
  markupId:
    name: markupId
    in: path
    description: the markup
    required: true
    type: string
  commentId:
    name: commentId
    in: path
    description: the comment
    required: true
    type: string
  attachmentId:
    name: attachmentId
    in: path
    description: the attachment
    required: true
    type: string
  optionalSessionId:
    name: sessionIdsessionid
    in: header
    description: the user sessionId (optional;
sent only if sessionId query parameter was passed to editor url)
    required: false
    type: string
  fileSessionId:
    name: xSessionId
    in: header
    description: the file sessionId
    required: true
    type: string
paths:
  /files/{fileId}/diffs:
    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: diffs_get
      tags:
        - ARES Kudo Required
      responses:
        "200":
          description: Success
          schema:
            required:
              - status
              - baseContent
            properties:
              status: 
                type: string
                default: "ok"
              baseContent:
                type: string
                description: Base64 encoded content of file
                # responses may fall through to errors
        "404":
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
    put:
      description: Update file content
      # used as the method name of the controller
      operationId: diffs_put
      tags:
        - ARES Kudo Required
      parameters:
        - name: body
          in: body
          required: true
          schema:
            required:
              - baseContent
            properties:
              baseContent:
                type: string
                description: Base64 encoded content of 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"
  /files:
    postparameters:
      - $ref: '#/parameters/optionalSessionId'
    x-swagger-router-controller: files
    post:
      description: Create/Update a new file
      # used as the method name of the controller
      operationId: post_file
      tags:
        - ARES Kudo OptionalRequired
      consumes:
         - multipart/form-data
      parameters:
        - in: header
          name: fileId
          description: folderId ID of the file (New file will be created if this value is not specified)
          required: truefalse
          type: string
        - in: formData
          name: file
          required: true
          type: file
      responses:
        "200":
          description: Success
          schema:
            required:
              - statusid
              - changeIdfilename
            properties:  - isNewFile
           status:   - changeId
             typeproperties:
string               id: 
default: "ok"               changeIdtype: string
               typefilename:
string         # responses may fall through to errors type: string
      default:        isNewFile:
  description: Error             schematype:  boolean
          $ref: "#/definitions/ErrorResponse"   /files/{fileId}/xref/searchchangeId:
    # binds a127 app logic to a route     x-swagger-router-controllertype: filesstring
    post:    # responses may description:fall XRefthrough searchto errors
     # used as thedefault:
method name of the controller       operationId: xref_searchdescription: Error
          tagsschema:
        - ARES Kudo Optional
     $ref: "#/definitions/ErrorResponse"
  /files/{fileId}/data:
    parameters:
        - $ref: '#/parameters/fileId'
        - $ref: '#/parameters/optionalSessionId'
    # binds a127 app -logic name:to bodya route
    x-swagger-router-controller: files

    inget:
 body     description: Returns file content
  required: true   # used as the method name of the schema:controller
      operationId: data_get
    required:      tags:
        - pathARES Kudo Required
      produces:
   properties:     - application/octet-stream
        pathresponses:
        "200":
       type: array  description: Success
        # responses may fall through description:to xrefserrors
paths to search      "404":
          description: Error
          itemsschema:
            $ref: "#/definitions/ErrorResponse"
  
  type/files/{fileId}/xref/search:
string    # binds a127 responses:app logic to a route
    "200"x-swagger-router-controller: files
    post:
      description: SuccessXRef search
      # used as schema:the method name of the controller
       typeoperationId: objectxref_search
      tags:
     properties:   - ARES Kudo Optional
        statusparameters:
        - $ref: '#/parameters/fileId'
      type: string - $ref: '#/parameters/optionalSessionId'
        - name: body
  default: "ok"       in: body
      result:    required: true
           typeschema:
array            required:
    items:          - path
       type: object    properties:
              propertiespath:
                type: array
  path:              description: xrefs paths to search       type: string    
                filesitems: 
                  type: string
  type: array   responses:
        "200":
          itemsdescription: Success
          schema:
            type: objectarray
            items:
           properties:   type: object
              properties:
       "_id":         path: 
                  type: string
         # responses may fall through to errors files:
       default:           descriptiontype: Errorarray
          schema:        items:
    $ref: "#/definitions/ErrorResponse"   /files/{fileId}/preview:     # binds a127 app logic to a route type: object
  x-swagger-router-controller: files     post:       description: Optionally handle receiving updates previewsproperties:
      # used as the method name of the controller       operationId: preview_post
      tags"_id":
        - ARES Kudo Optional       parameters:         - $reftype: '#/parameters/fileId'string
        - $ref: '#/parameters/optionalSessionId' responses may fall through to errors
responses:         "200"default:
          description: SuccessError
          schema:
            type$ref: object"#/definitions/ErrorResponse"
  /files/{fileId}/preview:
    # binds a127 app logic properties:to a route
    x-swagger-router-controller: files
      statuspost:
      description: Optionally handle receiving updates previews
     type: string# used as the method name of the controller
      operationId: preview_post
default: "ok"     tags:
   # responses may fall through to- errorsARES Kudo Optional
      defaultparameters:
        -  description$ref: Error'#/parameters/fileId'
        -  schema$ref: '#/parameters/optionalSessionId'
        - in: formData
$ref: "#/definitions/ErrorResponse"         name: file
          required: true
     /files/{fileId}/info:     #type: bindsfile
a127 app logic to a route responses:
   x-swagger-router-controller: files    "200":
get:          description: ReturnsSuccess
file information       # used asschema:
the method name of the controller       operationIdtype: info_getobject
        tags:    properties:
    - ARES Kudo Required       parametersstatus: 
       - $ref: '#/parameters/fileId'        type: -string
$ref: '#/parameters/optionalSessionId'       responses:        default: "200ok":
        # responses may description:fall Successthrough to errors
        schemadefault:
          description: Error
required:          schema:
    - status       $ref: "#/definitions/ErrorResponse"
    type: object             properties:      
  /files/{fileId}/info:
    # status:binds a127 app logic to a route
    x-swagger-router-controller: files
     typeget:
string      description: Returns file information
      # default: "ok"
    used as the method name of the controller
      operationId: info_get
 filename:     tags:
        - ARES Kudo Required
type: string     parameters:
        - folderId:$ref: '#/parameters/fileId'
        - $ref: '#/parameters/optionalSessionId'
      typeresponses:
 string       "200":
       owner   description: Success
          schema:
     type: string      required:
  # responses may fall through to errors      - status
 "401":           descriptiontype: object
User is not autenticated         properties:
 schema:             $refstatus: "#/definitions/ErrorResponse"
        "404":        type: string
 description: File is not found           schemadefault: "ok"
           $ref: "#/definitions/ErrorResponse"   /files/{fileId}/sessionfilename: 
   #  binds a127 app logic to a route     parameterstype: string
     - $ref: '#/parameters/fileId'       - $ref: '#/parameters/optionalSessionId'
folderId: 
   x-swagger-router-controller: files     get:       descriptiontype: getstring
 file sessions       # used as the method nameowner: of
the controller       operationId: session_get       tagstype: string
       - File# Sessionsresponses may fall through to errors
 responses:         "200401":
          description: Success User is not autenticated
          schema:
            $ref: "# a pointer to a definition
 /definitions/ErrorResponse"
        "404":
          description: File is not found
          $refschema: "#/definitions/SessionsResponse"
 
            $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:
responses may fall through to errors   - User Sessions
   default:   operationId: auth_get
      descriptionparameters:
Error        - $ref: '#/parameters/optionalSessionId'
 schema:     responses:
       $ref: "#/definitions/ErrorResponse"
    post:# responses may fall through to errors
        description"200":
 Create file session. Sessions need to be either of type "view" or "edit"description: Success
        # used asschema:
the method name of the controller       operationIdtype: session_post object
         tags:   properties:
     - File Sessions       parametersstatus: 
       - name: body       type: string
  in: body           required: true default: "ok"
        schema401:
          description: Authorization information required:is missing or invalid.
  /users:
    # binds a127 app -logic modeto a route
    x-swagger-router-controller: users
    propertiesget:
      description: Returns user object
    mode:  # used as the method name of the controller
      typeoperationId: stringusers_get
      tags:
        - description:User TypeSessions
of session requested    parameters:
        - $ref: '#/parameters/sessionId'
    enum: [view, edit] responses:
        # responses may fall through to fileId:errors
        "200":
       type: string  description: Success
             descriptionschema:
fileId for the file for which the session is being requested  type: object
       responses:     properties:
   "200":           descriptionstatus: Success
          schema:      type: string
     required:           default:  "ok"
 - status            results:
  - "_id"             propertiestype: array
             status:   items: 
              type: string     type: object
          default: "ok"         properties:
     "_id":                 typefname:
string         # responses may fall through to errors         defaulttype: string
         description:    Error           schemadescription: first name
          $ref: "#/definitions/ErrorResponse"     delete:       descriptionsurname:
delete file session       # used as the method name of the controller       operationIdtype: session_deletestring
      tags:         - File Sessions       parametersdescription: last name of user
    - $ref: '#/parameters/fileSessionId'       responses:         "200_id":
          description: Success           schema:  type: string
         required:             email:
 - status             properties:         type: string
    status:                  typelicenseExpirationDate: string
  
             default: "ok"         # responsestype: mayinteger
fall through to errors         default:           descriptionpreferences:
Error           schema:             $reftype: "#/definitions/ErrorResponse"
object
 /auth:     # binds a127 app logic to a route     x-swagger-router-controller: auth     getproperties:
      description: validate user session       # used as the method name of the controller  preferences_display:
    tags:         - User Sessions       operationId: auth_get       parameterstype: object
       - $ref: '#/parameters/sessionId'       responses:         # responses may fallproperties: through
to errors         "200":           description: Success        graphicswinmodelbackgrndcolor:
  schema:             type: object             properties:   type: string
          status:                  type: string   default:  White
           default: "ok"         401:     view:
     description: Authorization information is missing or invalid.   /users:     # binds a127 app logic to a route  type: object
 x-swagger-router-controller: users     get:       description: Returns user object       # used aswindow:
the method name of the controller       operationId: users_get       tags:        type: -object
User Sessions       parameters:         - $ref: '#/parameters/sessionId'       responsesvariables:
        # responses may fall through to errors         "200":      type: object
   description: Success           schema:             typeproperties: object
            properties:               status:   dynasnap:
              type: string                 defaulttype: string
"ok"               results:                 typedefault: array"63"
    put:
      description: Returns user object
 items:     # used as the method name of the controller
      operationId: users_put
  type: object   tags:
        - User Sessions
      propertiesparameters:
        - $ref: '#/parameters/sessionId'
        -   fnamename: body
          in: body
           typerequired: stringtrue
          schema:
             descriptionproperties:
first name             preferences:
         surname:       type: object
                typedescription: user preferences
string                properties:
        description:  last name of user     window:
                 "_id":   type: object
                    typeproperties:
string                       emailedit:
                        type: stringobject
                      licenseExpirationDate:  properties:
                      type: integer   dockwidgets:
                   preferences:         type: object
              type: object             properties:
           properties:                     layerwindow:
     preferences_display:                             type: object
                            properties:    properties:
                           graphicswinmodelbackgrndcolor:       h:
                         type: string                 type: string
               default: White                    description: height o the layerwindow

 window:     responses:
        # responses may fall through to errors
        type"200":
object          description: Success
          schema:
      properties:      type: object
            properties:
          edit:    status: 
                type: string
         type: object      default: "ok"
  /v1/files/{fileId}/annotations:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
  view:  get:
      description: Returns annotations for a file
      # used as the method name of the controller
   type: object  operationId: annotations_get
      tags:
        - Commenting
      variablesparameters:
        - $ref: '#/parameters/fileId'
        - $ref: '#/parameters/sessionId'
      type: object -    name: timestamp
          type: integer
          propertiesin: query
          required: false
          description: timestamp of last request to only send new dynasnap:items
      responses:
        # responses may fall through to errors
        "200":
 type: string        description: Success
          schema:
            defaulttype: "63"object
     put:       descriptionproperties:
Returns user object       # used as the method namestatus: of
the controller       operationId: users_put       tagstype: string
       - User Sessions       parametersdefault: "ok"
       - $ref: '#/parameters/sessionId'     results:
   - name: body           intype: bodyobject
          required: true     properties:
     schema:             propertiestimestamp:
              preferences:      type: integer
         type: object          description: time of response
   description: user preferences             commmentThreads:
   properties:                 type:  window:array
                    typedescription: object""
                    propertiesitems:
                      edittype: object
                  markups:
     type: object              type: array
         properties:           description: ""
              dockwidgets:      items:
                      type: object
                  status:
         properties:           type:  string
                 layerwindow:   default: "ok"
  /v1/files/{fileId}/markups:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
       typeget:
object      description: Returns markups for a file
      # used as the method name of the controller
      propertiesoperationId: markups_get
      tags:
        - Commenting
      parameters:
        - h$ref: '#/parameters/fileId'
        - $ref: '#/parameters/sessionId'
        - name: timestamp
          type: integer
 type: string        in: query
          required: false
           description: timestamp of last description:request heightto oonly thesend layerwindownew items
      responses:
        # responses may fall through to errors
        "200":
          description: Success
          schema:
            type: object
            properties:
              status: 
                type: string
                default: "ok"
              /v1/files/{fileId}/annotationsresults:
    # binds a127 app logic to a route     x-swagger-router-controller: commentstype: object
         get:       descriptionproperties:
Returns annotations for a file       # used as the method name of thetimestamp:
controller       operationId: annotations_get       tags:     type: integer
  - Commenting       parameters:         - $refdescription: '#/parameters/fileId'
 time of response
      - $ref: '#/parameters/sessionId'         - namemarkups:
timestamp                type: integer   type: array
      in: query           required: false description: ""
        description: timestamp of last request to only send new items   items:
   responses:         # responses may fall through to errors    type: object
   "200":           description: Success   status:
       schema:             type: objectstring
            properties:        default: "ok"
  /v1/files/{fileId}/commentThreads:
  status:  # binds a127 app logic to a route
    x-swagger-router-controller: comments
  type  get:
string      description: Returns comments for a file
     default: "ok"# used as the method name of the controller
      timestampoperationId: commentThreads_get
      tags:
        type:- integerCommenting
      parameters:
        - description$ref: time of response'#/parameters/fileId'
        - $ref: '#/parameters/sessionId'
        -  commentThreadsname:      timestamp
          type: arrayinteger
          in: query
    description: ""     required: false
          itemsdescription: timestamp of last request to only send new items
       responses:
 type: object      # responses may fall through to errors
  markups:      "200":
          typedescription: arraySuccess
          schema:
     description: ""      type: object
         items:   properties:
               typestatus: object
  /v1/files/{fileId}/markups:     # binds a127 app logic to a route  type: string
 x-swagger-router-controller: comments     get:       description: Returns markups for a filedefault: "ok"
        # used as the method name ofresults:
the controller       operationId: markups_get       tagstype: object
        - Commenting       parametersproperties:

       - $ref: '#/parameters/fileId'         - $ref: '#/parameters/sessionId'timestamp:
        - name: timestamp           type: integer
          in: query         description: time required:of falseresponse
          description: timestamp of last request to only send newcommmentThreads:
items       responses:         # responses may fall throughtype: toarray
errors         "200":           description: Success""
            schema:        items:
    type: object             properties:    type: object
         status:         status:
        type: string           type: string
    default: "ok"               resultsdefault: "ok"
  /v1/files/{fileId}/commentThread:
    # binds a127 app logic to a route
 type: object  x-swagger-router-controller: comments
    post:
      description: Add properties:a new commentThread for a file
      # used as the method name of timestamp:the controller
      operationId: commentThread_post
      tags:
    type: integer   - Commenting
      parameters:
        - description$ref: time of response'#/parameters/fileId'
        - $ref: '#/parameters/sessionId'
        - markupsname: body
          in: body
       type: array  required: true
          schema: 
     description: ""      type: object
            properties:
items:              title:
        type: object       type: string
          status:    text:
                type: string
              state:
     default:  "ok"    /v1/files/{fileId}/commentThread:     #type: bindsstring
a127 app logic to a route     x-swagger-router-controller: comments     postenum:    [ACTIVE, RESOLVED]
  description: Add a new commentThread for a file     ids:
 # used as the method name of the controller       operationIdtype: commentThread_postarray
      tags:         - Commentingitems:
      parameters:         - $ref: '#/parameters/fileId'  type: string
     - $refresponses:
'#/parameters/sessionId'        # responses -may name:fall bodythrough to errors
        in"200":
body           requireddescription: trueSuccess
          schema:
             type: object
            properties:
              titlestatus: 
                type: string
               text default: "ok"
              timestamp:
type: string               statetype: integer
                typedescription: stringtime of response
  /v1/files/{fileId}/commentThread/{threadId}:
    # binds a127 app logic to a enum:route
[ACTIVE, RESOLVED]   x-swagger-router-controller: comments
    put:
      idsdescription: Update a commentThread 
      # used as the method name type:of arraythe controller
      operationId: commentThread_put
       itemstags:
        - Commenting
      parameters:
 type: string      - responses$ref: '#/parameters/fileId'
       # responses- may fall through to errors$ref: '#/parameters/sessionId'
        -   "200"$ref: '#/parameters/threadId'
        - descriptionname: Successbody
          schemain: body
           typerequired: objecttrue
            propertiesschema: 
             statustype: object
                typeproperties:
string              title:
  default: "ok"               timestamptype: string
               typetext:
integer                 descriptiontype: timestring
of response
  /v1/files/{fileId}/commentThread/{threadId}:     # binds a127 app logic to a route ids:
   x-swagger-router-controller: comments     put:       descriptiontype: array
  Update a commentThread        # used as the methoditems:
name of the controller       operationId: commentThread_put       tagstype: string
      responses:
    - Commenting   # responses may fall through parameters:to errors
       - $ref"200":
'#/parameters/fileId'         - $refdescription: '#/parameters/sessionId'Success
         - $refschema:
'#/parameters/threadId'           - nametype: bodyobject
            inproperties:
body              requiredstatus: true
                schematype: string
            type: object   default: "ok"
         properties:     timestamp:
         title:       type: integer
        type: string       description: time of response
    textget:
      description: get a commentThread 
     type: string# used as the method name of the controller
      idsoperationId: commentThread_get
      tags:
        type:- arrayCommenting
      parameters:
        - items:$ref: '#/parameters/fileId'
        - $ref: '#/parameters/sessionId'
        - type$ref: string'#/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 
    getdelete:
      description: getDelete a commentThreadcomment Thread 
      # used as the method name of the controller
      operationId: commentThread_getdelete
      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}/attachments:attachment:
    x-swagger-router-controller: comments
    post:
      description: Create a markup attachment
      # used as the method name of the controller
      operationId: attachment_post_markup
      tags:
        - Commenting
      consumes:
         - multipart/form-data
      parameters:
        - $ref: '#/parameters/fileId'
        - $ref: '#/parameters/sessionId'
        - in: formData
          name: fileattachment
          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
      tags:
        - Commenting
      parameters:
        - $ref: '#/parameters/fileId'
        - $ref: '#/parameters/sessionId'
      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}:
    # binds a127 app logic to a route
    x-swagger-router-controller: comments
    get:
      description: Retrieve attachment 
      # used as the method name of the controller
      operationId: attachment_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
  /swagger:
    x-swagger-pipe: swagger_raw
# complex objects have schema definitions
definitions:
  SessionsResponse:
    required:
      - status
      - results
    properties:
      status: 
        type: string
        default: "ok"
      results:
        type: array
        items: 
            type: object
            properties:
              mode:
                type: string
                enum: [view, edit]
              username:
                type: string
              sessionId:
                type: string
              userId:
                type: string

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