swagger: "2.0"
info:
  description: This is the swagger file that provides the API to fetch data from Qresp server
  version: "1.0"
  title: Swagger REST Article
consumes:
  - "application/json"
produces:
  - "application/json"

basePath: "/api"

# Paths supported by the server application
paths:
  /search:
    get:
      operationId: "project.api.search"
      tags:
        - "Papers"
      summary: "Fetches all papers"
      description: "Read the list of papers"
      parameters:
        - in: query
          name: searchWord
          type: string
          required: false
          description: Filter paper results based on search word
        - in: query
          name: paperTitle
          type: string
          required: false
          description: Filter paper results based on paper title
        - in: query
          name: doi
          type: string
          required: false
          description: Filter paper results based on paper doi
        - in: query
          name: tags
          type: string
          required: false
          description: Filter paper results based on paper tags
        - in: query
          name: collectionList
          type: string
          required: false
          description: Filter paper results based on collection. Seperate by comma for multiple values
        - in: query
          name: authorsList
          type: string
          required: false
          description: Filter paper results based on authors. Seperate by comma for multiple values
        - in: query
          name: publicationList
          required: false
          type: string
          description: Filter paper results based on publication. Seperate by comma for multiple values
      responses:
        200:
          description: "Successful read papers list operation"
          schema:
            type: "array"
            items:
              properties:
                _Search__abstract:
                  type: "string"
                _Search__authors:
                  type: "string"
                _Search__collections:
                  type: "array"
                _Search__doi:
                  type: "string"
                _Search__downloadPath:
                  type: "string"
                _Search__fileServerPath:
                  type: "string"
                _Search__folderAbsolutePath:
                  type: "string"
                _Search__id":
                  type: "string"
                _Search__notebookFile:
                  type: "string"
                _Search__notebookPath:
                  type: "string"
                _Search__publication:
                  type: "string"
                _Search__serverPath:
                  type: "string"
                _Search__tags:
                  type: "array"
                _Search__title:
                  type: "string"
                _Search__year:
                  type: "integer"
  /collections:
    get:
      operationId: "project.api.collections"
      tags:
        - "Collections"
      summary: "Fetches all collections"
      description: "Fetches collections from all Papers"
      responses:
        200:
          description: "Successful read collections list operation"
          schema:
            type: "array"
            items:
                type: "string"
  /authors:
    get:
      operationId: "project.api.authors"
      tags:
        - "Authors"
      summary: "Fetches all authors"
      description: "Fetches authors from papers"
      responses:
        200:
          description: "Successful read authors list operation"
          schema:
            type: "array"
            items:
                type: "string"
  /publications:
    get:
      operationId: "project.api.publications"
      tags:
        - "Publications"
      summary: "Fetches all publications"
      description: "Fetches publications from all papers"
      responses:
        200:
          description: "Successful read paper publications operation"
          schema:
            type: "array"
            items:
                type: "string"
  /paper/{id}:
    get:
      operationId: "project.api.paper"
      tags:
        - "Paper details"
      summary: "Fetches details of paper given id"
      description: "Fetches paper details given id"
      parameters:
        - in: path
          name: id
          type: string
          required: true
          description: Paper Id
      responses:
        200:
          description: "Successful read paper details "
  /workflow/{id}:
    get:
      operationId: "project.api.workflow"
      tags:
        - "Workflow details"
      summary: "Fetches workflow of paper given id"
      description: "Fetches workflow of paper given id"
      parameters:
        - in: path
          name: id
          type: string
          required: true
          description: Paper Id
      responses:
        200:
          description: "Successful read workflow details of paper"
  /paper/{id}/chart/{cid}:
    get:
      operationId: "project.api.chart"
      tags:
        - "Chart details"
      summary: "Fetches chart of paper given id of paper and chart"
      description: "Fetches chart of paper given id"
      parameters:
        - in: path
          name: id
          type: string
          required: true
          description: Paper Id
        - in: path
          name: cid
          type: string
          required: true
          description: Chart Id
      responses:
        200:
          description: "Successful read workflow details of paper"