Skip to content

Commit ec94bbe

Browse files
authored
Merge pull request #58 from XeroAPI/budgets-serialization-fix
Deserialize the date without a day
2 parents c155190 + 28badef commit ec94bbe

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

docs/v1/accounting/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12293,7 +12293,7 @@
1229312293
<nav id="scrollingNav">
1229412294
<ul class="sidenav nav nav-list">
1229512295
<li class="nav-header" data-group="Accounting"><strong>SDK: </strong><span id='sdk-name'></span></li>
12296-
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>1.8.0</li>
12296+
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>1.8.1</li>
1229712297
<li class="nav-header" data-group="Accounting"><a href="#api-Accounting">Methods</a></li>
1229812298
<li data-group="Accounting" data-name="createAccount" class="">
1229912299
<a href="#api-Accounting-createAccount">createAccount</a>

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ def read_file(filename):
4848
keywords="xero python sdk API oAuth",
4949
name="xero_python",
5050
packages=find_packages(include=["xero_python", "xero_python.*"]),
51-
version="1.8.0",
51+
version="1.8.1",
5252
)

xero_python/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__author__ = """Xero Developer API"""
44
__email__ = "[email protected]"
5-
__version__ = "1.8.0"
5+
__version__ = "1.8.1"

xero_python/api_client/deserializer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
)
2323

2424
MS_DATETIME_RE = re.compile(r"/Date\((?P<timestamp>-?\d+)(?P<tzinfo>[+-]\d{2,4})?\)/$")
25-
25+
DATE_WITH_NO_DAY_RE = re.compile("(\d\d\d\d)-(\d\d)")
2626

2727
def deserialize_routing(data_type, data, model_finder):
2828
"""Custom logic to find matching deserialize implementation and
@@ -250,6 +250,8 @@ def deserialize_datetime_ms(data_type, data, model_finder):
250250
timestamp_ms = int(match.groupdict()["timestamp"])
251251
timestamp_s = timestamp_ms / 1000
252252
return datetime.datetime.fromtimestamp(timestamp_s, tz=tz_info)
253+
elif DATE_WITH_NO_DAY_RE.match(str(data)):
254+
return datetime.datetime.strptime(data + '-01', '%Y-%m-%d')
253255
else:
254256
raise ValueError("Invalid datetime value {!r}".format(data))
255257

xero_python/docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ These endpoints are related to managing authentication tokens and identity for X
44
The `xero_python` package is automatically generated by the [XeroAPI SDK 2.0 Codegen](https://github.com/xero-github/xeroapi-sdk-codegen) project:
55

66
- API version: 2.13.4
7-
- Package version: 1.8.0
7+
- Package version: 1.8.1
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99
For more information, please visit [https://developer.xero.com](https://developer.xero.com)
1010

0 commit comments

Comments
 (0)