apispec icon indicating copy to clipboard operation
apispec copied to clipboard

Add support for marshmallow.fields.Number.as_string

Open rockTA opened this issue 3 years ago • 2 comments

Some applications serialize decimal numbers as strings, as binary representation of floats can't be precise. However, when the OpenAPI documentation is created, this is currently not being taken into account if the Decimal type is used with the as_string option. With this change the documentation accurately represents what is being returned.

rockTA avatar Oct 19 '22 12:10 rockTA

Push :)

rockTA avatar Dec 21 '22 11:12 rockTA

This PR is also missing also adding format as decimal when using number as_string.

      amount:
          description: Some amount
          example: '90.00'
          readOnly: true
          type: string
          format: decimal

matejsp avatar Apr 25 '23 09:04 matejsp