openapi-httpx-client 0.2.1__tar.gz → 0.3.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.
- {openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/PKG-INFO +6 -1
- {openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/README.md +5 -0
- {openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/openapi_httpx_client.egg-info/PKG-INFO +6 -1
- {openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/openapiclient/client.py +3 -3
- {openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/setup.py +1 -1
- {openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/openapi_httpx_client.egg-info/SOURCES.txt +0 -0
- {openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/openapi_httpx_client.egg-info/dependency_links.txt +0 -0
- {openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/openapi_httpx_client.egg-info/requires.txt +0 -0
- {openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/openapi_httpx_client.egg-info/top_level.txt +0 -0
- {openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/openapiclient/__init__.py +0 -0
- {openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: openapi-httpx-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
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()
|
{openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/openapi_httpx_client.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: openapi-httpx-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
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
|
|
35
|
+
return method(*args, **kwargs)
|
|
38
36
|
|
|
39
37
|
|
|
40
38
|
# Create the main OpenAPIClient class
|
|
@@ -103,6 +101,8 @@ class OpenAPIClient:
|
|
|
103
101
|
content_type = response.headers.get('Content-Type', '')
|
|
104
102
|
if 'yaml' in content_type or 'yml' in content_type:
|
|
105
103
|
self.definition = yaml.safe_load(response.text)
|
|
104
|
+
elif self.definition_source.endswith('.yaml') or self.definition_source.endswith('.yml'):
|
|
105
|
+
self.definition = yaml.safe_load(response.text)
|
|
106
106
|
else:
|
|
107
107
|
self.definition = response.json()
|
|
108
108
|
else:
|
{openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/openapi_httpx_client.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{openapi-httpx-client-0.2.1 → openapi-httpx-client-0.3.1}/openapi_httpx_client.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|