From e0437353625fb373d3844cdd57c1f5e45f8536c2 Mon Sep 17 00:00:00 2001 From: Michael Huang Date: Mon, 25 Mar 2019 14:18:58 -0500 Subject: [PATCH] Fix regex validation on numeric inputs (#1731) * Fix regex validation on numeric inputs --- python-packages/sra_client/CHANGELOG.json | 11 +++++++++ .../sra_client/models/order_schema.py | 24 +++++++++---------- 2 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 python-packages/sra_client/CHANGELOG.json diff --git a/python-packages/sra_client/CHANGELOG.json b/python-packages/sra_client/CHANGELOG.json new file mode 100644 index 0000000000..7d6d2c4bb0 --- /dev/null +++ b/python-packages/sra_client/CHANGELOG.json @@ -0,0 +1,11 @@ +[ + { + "timestamp": 1553491629, + "version": "1.0.1", + "changes": [ + { + "note": "Fix regex validation on numeric values" + } + ] + } +] diff --git a/python-packages/sra_client/sra_client/models/order_schema.py b/python-packages/sra_client/sra_client/models/order_schema.py index 48fef39d84..1eeff510d1 100644 --- a/python-packages/sra_client/sra_client/models/order_schema.py +++ b/python-packages/sra_client/sra_client/models/order_schema.py @@ -185,10 +185,10 @@ class OrderSchema(object): "Invalid value for `maker_fee`, must not be `None`" ) # noqa: E501 if maker_fee is not None and not re.search( - r"^\\d+$", maker_fee + r"^\d+$", maker_fee ): # noqa: E501 raise ValueError( - r"Invalid value for `maker_fee`, must be a follow pattern or equal to `/^\\d+$/`" + r"Invalid value for `maker_fee`, must be a follow pattern or equal to `/^\d+$/`" ) # noqa: E501 self._maker_fee = maker_fee @@ -216,10 +216,10 @@ class OrderSchema(object): "Invalid value for `taker_fee`, must not be `None`" ) # noqa: E501 if taker_fee is not None and not re.search( - r"^\\d+$", taker_fee + r"^\d+$", taker_fee ): # noqa: E501 raise ValueError( - r"Invalid value for `taker_fee`, must be a follow pattern or equal to `/^\\d+$/`" + r"Invalid value for `taker_fee`, must be a follow pattern or equal to `/^\d+$/`" ) # noqa: E501 self._taker_fee = taker_fee @@ -278,10 +278,10 @@ class OrderSchema(object): "Invalid value for `maker_asset_amount`, must not be `None`" ) # noqa: E501 if maker_asset_amount is not None and not re.search( - r"^\\d+$", maker_asset_amount + r"^\d+$", maker_asset_amount ): # noqa: E501 raise ValueError( - r"Invalid value for `maker_asset_amount`, must be a follow pattern or equal to `/^\\d+$/`" + r"Invalid value for `maker_asset_amount`, must be a follow pattern or equal to `/^\d+$/`" ) # noqa: E501 self._maker_asset_amount = maker_asset_amount @@ -309,10 +309,10 @@ class OrderSchema(object): "Invalid value for `taker_asset_amount`, must not be `None`" ) # noqa: E501 if taker_asset_amount is not None and not re.search( - r"^\\d+$", taker_asset_amount + r"^\d+$", taker_asset_amount ): # noqa: E501 raise ValueError( - r"Invalid value for `taker_asset_amount`, must be a follow pattern or equal to `/^\\d+$/`" + r"Invalid value for `taker_asset_amount`, must be a follow pattern or equal to `/^\d+$/`" ) # noqa: E501 self._taker_asset_amount = taker_asset_amount @@ -401,9 +401,9 @@ class OrderSchema(object): raise ValueError( "Invalid value for `salt`, must not be `None`" ) # noqa: E501 - if salt is not None and not re.search(r"^\\d+$", salt): # noqa: E501 + if salt is not None and not re.search(r"^\d+$", salt): # noqa: E501 raise ValueError( - r"Invalid value for `salt`, must be a follow pattern or equal to `/^\\d+$/`" + r"Invalid value for `salt`, must be a follow pattern or equal to `/^\d+$/`" ) # noqa: E501 self._salt = salt @@ -493,10 +493,10 @@ class OrderSchema(object): "Invalid value for `expiration_time_seconds`, must not be `None`" ) # noqa: E501 if expiration_time_seconds is not None and not re.search( - r"^\\d+$", expiration_time_seconds + r"^\d+$", expiration_time_seconds ): # noqa: E501 raise ValueError( - r"Invalid value for `expiration_time_seconds`, must be a follow pattern or equal to `/^\\d+$/`" + r"Invalid value for `expiration_time_seconds`, must be a follow pattern or equal to `/^\d+$/`" ) # noqa: E501 self._expiration_time_seconds = expiration_time_seconds