ul-api-utils 7.7.1__py3-none-any.whl → 7.7.3__py3-none-any.whl
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.
Potentially problematic release.
This version of ul-api-utils might be problematic. Click here for more details.
- example/routes/api_some.py +15 -0
- ul_api_utils/resources/swagger.py +5 -1
- ul_api_utils/utils/flask_swagger_generator/specifiers/swagger_three_specifier.py +1 -1
- {ul_api_utils-7.7.1.dist-info → ul_api_utils-7.7.3.dist-info}/METADATA +1 -1
- {ul_api_utils-7.7.1.dist-info → ul_api_utils-7.7.3.dist-info}/RECORD +9 -9
- {ul_api_utils-7.7.1.dist-info → ul_api_utils-7.7.3.dist-info}/LICENSE +0 -0
- {ul_api_utils-7.7.1.dist-info → ul_api_utils-7.7.3.dist-info}/WHEEL +0 -0
- {ul_api_utils-7.7.1.dist-info → ul_api_utils-7.7.3.dist-info}/entry_points.txt +0 -0
- {ul_api_utils-7.7.1.dist-info → ul_api_utils-7.7.3.dist-info}/top_level.txt +0 -0
example/routes/api_some.py
CHANGED
|
@@ -53,6 +53,21 @@ class Some2Query(ApiRequestQuery):
|
|
|
53
53
|
@sdk.rest_api('POST', '/example-resource-simple', access=sdk.ACCESS_PUBLIC)
|
|
54
54
|
@sdk.cache_api('REFRESH', 'example')
|
|
55
55
|
def some5(api_resource: ApiResource, body: SomeBody) -> JsonApiResponse[List[RespObject]]:
|
|
56
|
+
"""
|
|
57
|
+
The API returns user details for a given username.
|
|
58
|
+
The API can be invoked using *curl* like below:
|
|
59
|
+
```
|
|
60
|
+
curl --header accept: application/json -u username:password http://localhost:8080/api/v2/user/jhondoe
|
|
61
|
+
```
|
|
62
|
+
**Sample Output**
|
|
63
|
+
```
|
|
64
|
+
{
|
|
65
|
+
"id": 2,
|
|
66
|
+
"username": "jhondoe"
|
|
67
|
+
"email": "jhon.doe@mail.com"
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
"""
|
|
56
71
|
return api_resource.response_ok([
|
|
57
72
|
RespObject(now=datetime.now() + timedelta(seconds=body.seconds)),
|
|
58
73
|
RespObject(now=datetime.now() + timedelta(seconds=body.seconds * 2)),
|
|
@@ -73,7 +73,11 @@ def load_swagger(sdk: 'ApiSdk', resources: List[ApiSdkResource], api_route_path_
|
|
|
73
73
|
specifier.write(f)
|
|
74
74
|
specifier.clean()
|
|
75
75
|
with open(swagger_open_api_cache_file, "r") as docs_file:
|
|
76
|
-
|
|
76
|
+
swagger_open_api_cache_file_data = docs_file.read()
|
|
77
|
+
docs_object = yaml.load(
|
|
78
|
+
swagger_open_api_cache_file_data,
|
|
79
|
+
Loader=yaml.FullLoader
|
|
80
|
+
)
|
|
77
81
|
return api_resource.response_root(docs_object)
|
|
78
82
|
except OSError:
|
|
79
83
|
return EmptyJsonApiResponse(ok=False, status_code=404)
|
|
@@ -309,7 +309,7 @@ class SwaggerRequestType(SwaggerModel):
|
|
|
309
309
|
if self.summary is not None:
|
|
310
310
|
request_type_entry += f"\n summary: {self.summary}"
|
|
311
311
|
if self.description is not None:
|
|
312
|
-
request_type_entry += f"\n description:
|
|
312
|
+
request_type_entry += f"\n description: | {self.description}"
|
|
313
313
|
request_type_entry = self.indent(request_type_entry, 2 * self.TAB)
|
|
314
314
|
|
|
315
315
|
file.write(request_type_entry)
|
|
@@ -6,7 +6,7 @@ example/pure_flask_example.py,sha256=A7cbcjTr28FS1sVNAsQbj1N9EgEFIXDB4aRwOV6_tbU
|
|
|
6
6
|
example/rate_limit_load.py,sha256=U2Bgp8UztT4TNKdv9NVioxWfE68aCsC7uKz7xPCy6XM,225
|
|
7
7
|
example/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
example/routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
example/routes/api_some.py,sha256=
|
|
9
|
+
example/routes/api_some.py,sha256=d_X3828IZFs7EAKcP_lX9hHRZaaOQw1XoehDU3ZHcnI,12232
|
|
10
10
|
example/workers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
example/workers/worker.py,sha256=flMYq50OhLtNSaA2qyDJSMeXSNXIqhdBIsaxcmO5-xQ,681
|
|
12
12
|
ul_api_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -70,7 +70,7 @@ ul_api_utils/resources/debugger_scripts.py,sha256=FnZ9UfAzi7WokEi6bRkrUAEH8lbR3o
|
|
|
70
70
|
ul_api_utils/resources/not_implemented.py,sha256=OQE5LGA4KqZDwP5Wtub3Aw-icwzbqCSKcEFoFp4w7_k,973
|
|
71
71
|
ul_api_utils/resources/permissions.py,sha256=8c8cEPkm69zxgXbDiwUkW6Mi_496-MZXbPOxHITetKs,1436
|
|
72
72
|
ul_api_utils/resources/rate_limitter.py,sha256=QMpaLu1LoFbvtIEhxF8HbAZIAW4oGKTClt7XEUsqx98,3358
|
|
73
|
-
ul_api_utils/resources/swagger.py,sha256=
|
|
73
|
+
ul_api_utils/resources/swagger.py,sha256=1Fz1TLtYsv8t5LG619QhchgUEuBZA0zM0vH5ARu5C8E,5358
|
|
74
74
|
ul_api_utils/resources/health_check/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
75
|
ul_api_utils/resources/health_check/const.py,sha256=QzVZP_ZKmVKleUACiOGjzP-v54FD7tEN6NEF4Jb50Ow,78
|
|
76
76
|
ul_api_utils/resources/health_check/health_check.py,sha256=bb_ONn3akNXxNFELIUcW6foqwiKqeinmr-Wl0fQ7Q4c,18449
|
|
@@ -107,7 +107,7 @@ ul_api_utils/utils/flask_swagger_generator/exceptions.py,sha256=yA4IsUyxh5puyoYz
|
|
|
107
107
|
ul_api_utils/utils/flask_swagger_generator/specifiers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
108
108
|
ul_api_utils/utils/flask_swagger_generator/specifiers/swagger_models.py,sha256=eMRDP60GUbIuBGinFPfjp7VsnbgmzockTsIT-KadchA,1690
|
|
109
109
|
ul_api_utils/utils/flask_swagger_generator/specifiers/swagger_specifier.py,sha256=9Cf1ijk90IDYUDG8kTjK4cxjdxpYjWZz1tKJHPCeDAA,1513
|
|
110
|
-
ul_api_utils/utils/flask_swagger_generator/specifiers/swagger_three_specifier.py,sha256=
|
|
110
|
+
ul_api_utils/utils/flask_swagger_generator/specifiers/swagger_three_specifier.py,sha256=wdUPeNK_p7uRTyOz0BggIZgp6ivUnJnhM9jQf_a2G3w,28923
|
|
111
111
|
ul_api_utils/utils/flask_swagger_generator/specifiers/swagger_version.py,sha256=A14IRG-e2KL2SlFbHep2FH0uMRIHPhfd7KLkYdtWrfA,1312
|
|
112
112
|
ul_api_utils/utils/flask_swagger_generator/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
113
113
|
ul_api_utils/utils/flask_swagger_generator/utils/input_type.py,sha256=Ynp3zI5q1F0Tl_eTdNbWoCxRKPwBCJkwJOoeHE2pTRE,2533
|
|
@@ -125,9 +125,9 @@ ul_api_utils/validators/validate_empty_object.py,sha256=3Ck_iwyJE_M5e7l6s1i88aqb
|
|
|
125
125
|
ul_api_utils/validators/validate_uuid.py,sha256=EfvlRirv2EW0Z6w3s8E8rUa9GaI8qXZkBWhnPs8NFrA,257
|
|
126
126
|
ul_api_utils/validators/__tests__/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
127
127
|
ul_api_utils/validators/__tests__/test_custom_fields.py,sha256=QLZ7DFta01Z7DOK9Z5Iq4uf_CmvDkVReis-GAl_QN48,1447
|
|
128
|
-
ul_api_utils-7.7.
|
|
129
|
-
ul_api_utils-7.7.
|
|
130
|
-
ul_api_utils-7.7.
|
|
131
|
-
ul_api_utils-7.7.
|
|
132
|
-
ul_api_utils-7.7.
|
|
133
|
-
ul_api_utils-7.7.
|
|
128
|
+
ul_api_utils-7.7.3.dist-info/LICENSE,sha256=6Qo8OdcqI8aGrswJKJYhST-bYqxVQBQ3ujKdTSdq-80,1062
|
|
129
|
+
ul_api_utils-7.7.3.dist-info/METADATA,sha256=AR5VZPjAu1mt6cnz_5Yy6uRAPfbW9VELySpRrEl1BPs,14454
|
|
130
|
+
ul_api_utils-7.7.3.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
131
|
+
ul_api_utils-7.7.3.dist-info/entry_points.txt,sha256=8tL3ySHWTyJMuV1hx1fHfN8zumDVOCOm63w3StphkXg,53
|
|
132
|
+
ul_api_utils-7.7.3.dist-info/top_level.txt,sha256=1XsW8iOSFaH4LOzDcnNyxHpHrbKU3fSn-aIAxe04jmw,21
|
|
133
|
+
ul_api_utils-7.7.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|