-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding decimal support for python client generation #19203
Changes from 4 commits
5ade177
72703b5
0b848e3
8180d87
3724025
bc0195c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,11 @@ | |
$ pytest | ||
""" | ||
|
||
import os | ||
import time | ||
import atexit | ||
import weakref | ||
import unittest | ||
from dateutil.parser import parse | ||
from decimal import Decimal | ||
|
||
import petstore_api | ||
import petstore_api.configuration | ||
|
@@ -156,6 +155,11 @@ def test_sanitize_for_serialization(self): | |
result = self.api_client.sanitize_for_serialization(data) | ||
self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") | ||
|
||
# decimal | ||
data = Decimal("1.0") | ||
result = self.api_client.sanitize_for_serialization(data) | ||
self.assertEquals(result, "1.0") | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, can you move this into The "pydantic v1" backend will be removed at some point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh good catch, thats on me, fixing now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @multani @wing328 do i need to worry about the failing steps in the build? They appear to be failures to install poetry for the v1 petstore sample.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, I can't retry, but I don't think it's related to your change :) |
||
# list | ||
data = [1] | ||
result = self.api_client.sanitize_for_serialization(data) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert this change? It has nothing to do with your original PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bc0195c