cancel
Showing results for 
Search instead for 
Did you mean: 

Sample Double Values Rounded in Mock Response

SOLVED
jshier
Occasional Contributor

Sample Double Values Rounded in Mock Response

I've created a Location type that return latitude and longitude coordinate values, which are marked as doubles. However, in the mock response, the sample values are being rounded to integers, which is obviously unrealistic. Here's the coordinate definition:

 

Coordinate:
      type: object
      description: "The latitude and longitude associated with a location, specified in WGS 84 reference frame."
      required:
        - longitude
        - latitude
      properties:
        longitude:
          type: number
          format: double
          description: "A longitude value as a double, with positive values being east of the meridian, negative values west."
          maximum: 180.0
          minimum: -180.0
          example: -82.003185
        latitude:
          type: number
          format: double
          description: "A latitude value as a double, with positive values being north of the equator, negaitive values south."
          maximum: 180.0
          minimum: -180.0
          example: 43.505

In the response the sample values are rounded to -82 and 43. Any way to fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
HKosova
Moderator

Re: Sample Double Values Rounded in Mock Response

Hi Jon,

 

Thanks for your patience! We've pushed out a fix for the double rounding issue, so the workaround is no longer needed. To update the mock, either save your API again, or trigger the mock manually from the integrations list. Let us know if you see any further issues.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

2 REPLIES 2
HKosova
Moderator

Re: Sample Double Values Rounded in Mock Response

Hi Jon,

 

Thanks for the report! I've reproduced the issue and logged an internal bug for it.

 

In the meantime, please add a schema-level example as shown below - the mock response will use the correct values in this case.

    Coordinate:
      type: object
      ...
      example:
        longitude: -82.003185
        latitude: 43.505

Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
HKosova
Moderator

Re: Sample Double Values Rounded in Mock Response

Hi Jon,

 

Thanks for your patience! We've pushed out a fix for the double rounding issue, so the workaround is no longer needed. To update the mock, either save your API again, or trigger the mock manually from the integrations list. Let us know if you see any further issues.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors