openapi-httpx-client 0.4.0__tar.gz → 0.4.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: openapi-httpx-client
3
- Version: 0.4.0
3
+ Version: 0.4.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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openapi-httpx-client
3
- Version: 0.4.0
3
+ Version: 0.4.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
@@ -1,3 +1,2 @@
1
1
  httpx>=0.23.0
2
2
  pyyaml>=6.0
3
- nanoid>=0.2.1
@@ -1,10 +1,8 @@
1
1
  import httpx
2
2
  import json
3
3
  import os.path
4
- from typing import Dict, List, Any, Optional, Union, Callable, Type
5
4
  from urllib.parse import urljoin, urlparse
6
5
  import yaml
7
- from nanoid import generate as nanoid_generate
8
6
 
9
7
  # 合并DynamicClientBase和BaseClient为一个基类
10
8
  class BaseClient:
@@ -189,6 +187,10 @@ class OpenAPIClient:
189
187
 
190
188
  async def _load_definition_async(self):
191
189
  """Load the OpenAPI definition asynchronously"""
190
+ # Check if definition is already loaded
191
+ if self.definition:
192
+ return
193
+
192
194
  if isinstance(self.definition_source, dict):
193
195
  self.definition = self.definition_source
194
196
  return
@@ -209,6 +211,10 @@ class OpenAPIClient:
209
211
 
210
212
  def _load_definition_sync(self):
211
213
  """Load the OpenAPI definition synchronously"""
214
+ # Check if definition is already loaded
215
+ if self.definition:
216
+ return
217
+
212
218
  if isinstance(self.definition_source, dict):
213
219
  self.definition = self.definition_source
214
220
  return
@@ -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.4.0",
8
+ version="0.4.1",
9
9
  author="lloydzhou",
10
10
  author_email="lloydzhou@qq.com",
11
11
  description="A Python client for OpenAPI specifications using httpx",
@@ -16,7 +16,6 @@ setup(
16
16
  install_requires=[
17
17
  "httpx>=0.23.0",
18
18
  "pyyaml>=6.0",
19
- "nanoid>=0.2.1",
20
19
  ],
21
20
  classifiers=[
22
21
  "Programming Language :: Python :: 3",