@typespec/http-client-python 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eng/scripts/setup/__pycache__/venvtools.cpython-38.pyc +0 -0
- package/generator/dev_requirements.txt +2 -2
- package/generator/pygen/codegen/models/primitive_types.py +1 -1
- package/generator/pygen/codegen/templates/model_base.py.jinja2 +1 -1
- package/generator/pygen/codegen/templates/serialization.py.jinja2 +7 -3
- package/generator/test/azure/requirements.txt +2 -2
- package/generator/test/unbranded/requirements.txt +2 -2
- package/package.json +1 -1
|
Binary file
|
|
@@ -340,7 +340,7 @@ class StringType(PrimitiveType):
|
|
|
340
340
|
return validation or None
|
|
341
341
|
|
|
342
342
|
def get_declaration(self, value) -> str:
|
|
343
|
-
return f'"{value}"'
|
|
343
|
+
return f"'{value}'" if value == '"' else f'"{value}"'
|
|
344
344
|
|
|
345
345
|
@property
|
|
346
346
|
def serialization_type(self) -> str:
|
|
@@ -752,7 +752,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur
|
|
|
752
752
|
except AttributeError:
|
|
753
753
|
model_name = annotation
|
|
754
754
|
if module is not None:
|
|
755
|
-
annotation = _get_model(module, model_name)
|
|
755
|
+
annotation = _get_model(module, model_name) # type: ignore
|
|
756
756
|
|
|
757
757
|
try:
|
|
758
758
|
if module and _is_model(annotation):
|
|
@@ -1682,17 +1682,21 @@ class Deserializer(object):
|
|
|
1682
1682
|
subtype = getattr(response, "_subtype_map", {})
|
|
1683
1683
|
try:
|
|
1684
1684
|
readonly = [
|
|
1685
|
-
k
|
|
1685
|
+
k
|
|
1686
|
+
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
|
|
1687
|
+
if v.get("readonly")
|
|
1686
1688
|
]
|
|
1687
1689
|
const = [
|
|
1688
|
-
k
|
|
1690
|
+
k
|
|
1691
|
+
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
|
|
1692
|
+
if v.get("constant")
|
|
1689
1693
|
]
|
|
1690
1694
|
kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const}
|
|
1691
1695
|
response_obj = response(**kwargs)
|
|
1692
1696
|
for attr in readonly:
|
|
1693
1697
|
setattr(response_obj, attr, attrs.get(attr))
|
|
1694
1698
|
if additional_properties:
|
|
1695
|
-
response_obj.additional_properties = additional_properties
|
|
1699
|
+
response_obj.additional_properties = additional_properties # type: ignore
|
|
1696
1700
|
return response_obj
|
|
1697
1701
|
except TypeError as err:
|
|
1698
1702
|
msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore
|
|
@@ -4,10 +4,10 @@ pytest
|
|
|
4
4
|
pytest-asyncio==0.14.0;python_full_version>="3.5.2"
|
|
5
5
|
azure-core==1.30.0
|
|
6
6
|
azure-mgmt-core==1.3.2
|
|
7
|
-
pyright==1.1.
|
|
7
|
+
pyright==1.1.389
|
|
8
8
|
pylint==3.2.7
|
|
9
9
|
tox==4.18.1
|
|
10
|
-
mypy==1.
|
|
10
|
+
mypy==1.13.0
|
|
11
11
|
|
|
12
12
|
# only for azure
|
|
13
13
|
-e ./generated/azure-client-generator-core-access
|