openapi-httpx-client 0.2.1__tar.gz → 0.3.0__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: openapi-httpx-client
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: A Python client for OpenAPI specifications using httpx
5
5
  Home-page: https://github.com/lloydzhou/openapiclient
6
6
  Author: lloydzhou
@@ -49,6 +49,11 @@ async def main():
49
49
  # Print the response
50
50
  print(f"Status code: {response['status']}")
51
51
  print(f"Pet data: {response['data']}")
52
+
53
+ # Call an operation using the generated method
54
+ response = await client('getPetById', petId=1)
55
+ print(f"Status code: {response['status']}")
56
+ print(f"Pet data: {response['data']}")
52
57
  finally:
53
58
  # Close the HTTP session
54
59
  await api.close()
@@ -34,6 +34,11 @@ async def main():
34
34
  # Print the response
35
35
  print(f"Status code: {response['status']}")
36
36
  print(f"Pet data: {response['data']}")
37
+
38
+ # Call an operation using the generated method
39
+ response = await client('getPetById', petId=1)
40
+ print(f"Status code: {response['status']}")
41
+ print(f"Pet data: {response['data']}")
37
42
  finally:
38
43
  # Close the HTTP session
39
44
  await api.close()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openapi-httpx-client
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: A Python client for OpenAPI specifications using httpx
5
5
  Home-page: https://github.com/lloydzhou/openapiclient
6
6
  Author: lloydzhou
@@ -49,6 +49,11 @@ async def main():
49
49
  # Print the response
50
50
  print(f"Status code: {response['status']}")
51
51
  print(f"Pet data: {response['data']}")
52
+
53
+ # Call an operation using the generated method
54
+ response = await client('getPetById', petId=1)
55
+ print(f"Status code: {response['status']}")
56
+ print(f"Pet data: {response['data']}")
52
57
  finally:
53
58
  # Close the HTTP session
54
59
  await api.close()
@@ -3,8 +3,6 @@ import json
3
3
  import os.path
4
4
  from urllib.parse import urljoin, urlparse
5
5
  import yaml
6
- import types
7
- import functools
8
6
  from nanoid import generate as nanoid_generate
9
7
 
10
8
  # Create a base class for DynamicClient
@@ -34,7 +32,7 @@ class DynamicClientBase:
34
32
  if not method or not callable(method):
35
33
  raise AttributeError(f"'{self.__class__.__name__}' has no callable method '{method_name}'")
36
34
 
37
- return functools.partial(method, *args, **kwargs)
35
+ return method(*args, **kwargs)
38
36
 
39
37
 
40
38
  # Create the main OpenAPIClient class
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name="openapi-httpx-client",
8
- version="0.2.1",
8
+ version="0.3.0",
9
9
  author="lloydzhou",
10
10
  author_email="lloydzhou@qq.com",
11
11
  description="A Python client for OpenAPI specifications using httpx",