Optional entering of a date range

35 views
Skip to first unread message

Edward Boone

unread,
Nov 28, 2018, 5:22:28 PM11/28/18
to Swagger
Hello, 

I'm programming an API for my master thesis. However, I have no experience with Swagger at all. For the following path, I would like to make it possible for the user to selecte a time range (e.g. from January first 2017 to July fifth 2018). If the user doesn't enter such a range, the value should be calculated based on all-time data.

  /Reproduction/Cow/Youngstock/{KPI}:
    get:
      parameters: 
      - in: path
        name: KPI
        required: true
        type: string
        enum: [Days to first heat, 
               Days to first insemination, 
               Days open, 
               Interval first-last insemination, Calving Interval, 
               Historic Calving Interval,
               Expected Calving Interval,
               Predicted Calving Interval]
        description: Name of the KPI
      tags: 
      - "Reproduction"
      summary: Search KPI
      operationId: findRKPI-CL-YS
      produces:
      - application/json
      - application/xml
      - application/csv
      responses:
        200:
          description: Results
          schema:
            type: array
            items:
              $ref: '#/definitions/KPI'
        400:
          description: Nothing found

Anybody who can help me on this? You would be of great help! Thank you!
Reply all
Reply to author
Forward
0 new messages