requestmodel 0.6.0__tar.gz → 0.6.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: requestmodel
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: requestmodel
5
5
  Home-page: https://github.com/foarsitter/requestmodel
6
6
  License: MIT
@@ -47,7 +47,7 @@ Description-Content-Type: text/markdown
47
47
 
48
48
  - Model your http requests as a pydantic model
49
49
  - Annotate your request parameters with fastapi params
50
- - Support voor sync & async requests
50
+ - Support for sync & async requests
51
51
 
52
52
  ## Goals
53
53
 
@@ -23,7 +23,7 @@
23
23
 
24
24
  - Model your http requests as a pydantic model
25
25
  - Annotate your request parameters with fastapi params
26
- - Support voor sync & async requests
26
+ - Support for sync & async requests
27
27
 
28
28
  ## Goals
29
29
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "requestmodel"
3
- version = "0.6.0"
3
+ version = "0.6.1"
4
4
  description = "requestmodel"
5
5
  authors = ["Jelmer Draaijer <info@jelmert.nl>"]
6
6
  license = "MIT"
@@ -25,7 +25,7 @@ requests = "^2.31.0"
25
25
 
26
26
  [tool.poetry.group.dev.dependencies]
27
27
  pytest-asyncio = "^0.21.1"
28
- python-multipart = "^0.0.6"
28
+ python-multipart = "^0.0.7"
29
29
  flask-wtf = "^1.2.1"
30
30
  flask-pytest = "^0.0.5"
31
31
  a2wsgi = "^1.8.0"
@@ -168,7 +168,7 @@ def jsonable_encoder( # noqa: C901
168
168
  exclude_defaults=exclude_defaults,
169
169
  sqlalchemy_safe=sqlalchemy_safe,
170
170
  )
171
- if dataclasses.is_dataclass(obj):
171
+ if dataclasses.is_dataclass(obj) and not isinstance(obj, type):
172
172
  obj_dict = dataclasses.asdict(obj)
173
173
  return jsonable_encoder(
174
174
  obj_dict,
@@ -107,6 +107,8 @@ class RequestModel(BaseRequestModel[ResponseType]):
107
107
  r = self.as_request(client)
108
108
  self.raw_response = await client.send(r)
109
109
  self.handle_error(self.raw_response)
110
+ if isinstance(self.response_model, TypeAdapter):
111
+ return self.response_model.validate_python(self.raw_response.json())
110
112
  return self.response_model.model_validate(self.raw_response.json())
111
113
 
112
114
  def as_request(self, client: BaseClient) -> Request:
File without changes