# NOTE: Do not upgrade past Swagger 2. zclient does not support OpenAPI 3 unless
# https://github.com/Yelp/bravado/issues/306 is resolved.
swagger: "2.0"
info:
  description: "A generalized microservice for receiving feedback on our internal tools"
  version: "1.0.0"
  title: "tools_feedback"
  contact:
    name: "mmyers"
    email: "mmyers@zoox.com"
    url: "https://git.zooxlabs.com/zooxco/driving"
basePath: /v1
paths:
  /feedback:
    put:
      summary: "Give feedback"
      operationId: "giveFeedback"
      consumes: ["application/json"]
      parameters:
        - name: feedback
          in: body
          description: User who is giving feedback
          required: true
          schema:
            $ref: "#/definitions/Feedback"
      responses:
        "200":
          description: "Got the feedback. Thanks!"
        "400": {$ref: "#/responses/BadRequest"}
        "500": {$ref: "#/responses/InternalServerError"}
definitions:
  Feedback:
    type: object
    properties:
      user:
        type: string
        description: "User's email"
      feedback:
        type: string
        description: "User's feedback"
      application:
        $ref: "#/definitions/Application"
        description: "Application that the feedback is from"
    required:
      - user
      - feedback
      - application
  Application:
    description: "The application the feedback is from"
    type: "string"
    enum:
      - "FLEETDASH"
      - "COREDASH"
  ErrorInfo:
    type: "object"
    description: "Object containing error information."
    properties:
      statusCode:
        type: "integer"
        description: "Error status code."
      message:
        type: "string"
        description: "Error message."
    required:
      - "statusCode"
      - "message"
    additionalProperties: false
responses:
  BadRequest:
    description: "Bad request."
    schema:
      $ref: "#/definitions/ErrorInfo"
  InternalServerError:
    description: "Internal server error."
    schema:
      $ref: "#/definitions/ErrorInfo"
