sgn icon indicating copy to clipboard operation
sgn copied to clipboard

Seasons call 'year' response should be an integer

Open chaneylc opened this issue 1 year ago • 0 comments
trafficstars

Expected Behavior

The BrAPI spec shows that a call to GET /seasons should return an integer for the 'year' field, breedbase instances return a string.

Spec:

 /seasons:
    get:
      description: "Call to retrieve all seasons in the database.\n\nA season is made of 2 parts; the primary year and a term which defines a segment of the year. \nThis could be a traditional season, like \"Spring\" or \"Summer\" or this could be a month, like \n\"May\" or \"June\" or this could be an arbitrary season name which is meaningful to the breeding \nprogram like \"PlantingTime_3\" or \"Season E\""
      parameters:
      - description: The 4 digit year of a season. Example "2017"
        example: 2017
        in: query
        name: year
        required: false
        schema:
          type: integer

Current response:

{"result":{"data":[{"season":"","year":"1969","seasonDbId":"1969"},{"season":"","year":"1981","seasonDbId":"1981"},

{"seasonDbId":"1983","season":"","year":"1983"},{"seasonDbId":"1984","year":"1984","season":""},

{"year":"1985","season":"","seasonDbId":"1985"},{"season":"","year":"1986","seasonDbId":"1986"},

{"seasonDbId":"1987","season":"","year":"1987"},{"season":"","year":"1988","seasonDbId":"1988"},

Correct response (different data) from test server:


{"seasonDbId":"fall_2011","seasonName":"fall","year":2011},

{"seasonDbId":"fall_2012","seasonName":"fall","year":2012},

{"seasonDbId":"fall_2013","seasonName":"fall","year":2013},

{"seasonDbId":"spring_2012","seasonName":"spring","year":2012},

For Bugs:

Environment

cassavabase, wheat-sandbox, any breedbase server

Steps to Reproduce

Any client that expects the correct spec will fail when parsing these results.

chaneylc avatar Aug 05 '24 20:08 chaneylc