jentic-openapi-transformer 1.0.0a12__tar.gz → 1.0.0a14__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.
Potentially problematic release.
This version of jentic-openapi-transformer might be problematic. Click here for more details.
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/PKG-INFO +5 -5
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/pyproject.toml +5 -5
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/src/jentic/apitools/openapi/transformer/core/references.py +39 -0
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/LICENSE +0 -0
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/NOTICE +0 -0
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/README.md +0 -0
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/src/jentic/apitools/openapi/transformer/bundler/backends/base.py +0 -0
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/src/jentic/apitools/openapi/transformer/bundler/backends/default.py +0 -0
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/src/jentic/apitools/openapi/transformer/bundler/backends/py.typed +0 -0
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/src/jentic/apitools/openapi/transformer/bundler/core/__init__.py +0 -0
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/src/jentic/apitools/openapi/transformer/bundler/core/bundler.py +0 -0
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/src/jentic/apitools/openapi/transformer/bundler/core/py.typed +0 -0
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/src/jentic/apitools/openapi/transformer/core/__init__.py +0 -0
- {jentic_openapi_transformer-1.0.0a12 → jentic_openapi_transformer-1.0.0a14}/src/jentic/apitools/openapi/transformer/core/normalize.py +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jentic-openapi-transformer
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0a14
|
|
4
4
|
Summary: Jentic OpenAPI Transformer
|
|
5
5
|
Author: Jentic
|
|
6
6
|
Author-email: Jentic <hello@jentic.com>
|
|
7
7
|
License-Expression: Apache-2.0
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
License-File: NOTICE
|
|
10
|
-
Requires-Dist: jentic-openapi-common~=1.0.
|
|
11
|
-
Requires-Dist: jentic-openapi-parser~=1.0.
|
|
12
|
-
Requires-Dist: jentic-openapi-traverse~=1.0.
|
|
13
|
-
Requires-Dist: jentic-openapi-transformer-redocly~=1.0.
|
|
10
|
+
Requires-Dist: jentic-openapi-common~=1.0.0a14
|
|
11
|
+
Requires-Dist: jentic-openapi-parser~=1.0.0a14
|
|
12
|
+
Requires-Dist: jentic-openapi-traverse~=1.0.0a14
|
|
13
|
+
Requires-Dist: jentic-openapi-transformer-redocly~=1.0.0a14 ; extra == 'redocly'
|
|
14
14
|
Requires-Python: >=3.11
|
|
15
15
|
Project-URL: Homepage, https://github.com/jentic/jentic-openapi-tools
|
|
16
16
|
Provides-Extra: redocly
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "jentic-openapi-transformer"
|
|
3
|
-
version = "1.0.0-alpha.
|
|
3
|
+
version = "1.0.0-alpha.14"
|
|
4
4
|
description = "Jentic OpenAPI Transformer"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{ name = "Jentic", email = "hello@jentic.com" }]
|
|
@@ -8,9 +8,9 @@ license = "Apache-2.0"
|
|
|
8
8
|
license-files = ["LICENSE", "NOTICE"]
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
10
|
dependencies = [
|
|
11
|
-
"jentic-openapi-common~=1.0.0-alpha.
|
|
12
|
-
"jentic-openapi-parser~=1.0.0-alpha.
|
|
13
|
-
"jentic-openapi-traverse~=1.0.0-alpha.
|
|
11
|
+
"jentic-openapi-common~=1.0.0-alpha.14",
|
|
12
|
+
"jentic-openapi-parser~=1.0.0-alpha.14",
|
|
13
|
+
"jentic-openapi-traverse~=1.0.0-alpha.14",
|
|
14
14
|
]
|
|
15
15
|
|
|
16
16
|
[tool.uv]
|
|
@@ -22,7 +22,7 @@ module-name = "jentic.apitools.openapi.transformer"
|
|
|
22
22
|
module-root = "src/"
|
|
23
23
|
|
|
24
24
|
[project.optional-dependencies]
|
|
25
|
-
redocly = ["jentic-openapi-transformer-redocly~=1.0.0-alpha.
|
|
25
|
+
redocly = ["jentic-openapi-transformer-redocly~=1.0.0-alpha.14"]
|
|
26
26
|
|
|
27
27
|
[project.urls]
|
|
28
28
|
Homepage = "https://github.com/jentic/jentic-openapi-tools"
|
|
@@ -18,9 +18,48 @@ __all__ = [
|
|
|
18
18
|
"RewriteOptions",
|
|
19
19
|
"rewrite_urls_inplace",
|
|
20
20
|
"iter_url_fields",
|
|
21
|
+
"count_references",
|
|
21
22
|
]
|
|
22
23
|
|
|
23
24
|
|
|
25
|
+
def count_references(root: Any) -> Tuple[int, int, int, int]:
|
|
26
|
+
"""
|
|
27
|
+
Counts the number of references in a given data structure based on their type.
|
|
28
|
+
|
|
29
|
+
This function iterates through the provided structure to analyze and classify
|
|
30
|
+
different kinds of references. The classification includes relative references,
|
|
31
|
+
absolute HTTP/HTTPS references, local references, and the total number of
|
|
32
|
+
references.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
root: Any
|
|
36
|
+
The root data structure containing references to be analyzed.
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
Tuple[int, int, int, int]: A tuple containing the following counts:
|
|
40
|
+
- Total references count
|
|
41
|
+
- Local references count
|
|
42
|
+
- Relative references count
|
|
43
|
+
- Absolute HTTP/HTTPS references count
|
|
44
|
+
"""
|
|
45
|
+
relative_refs_count = 0
|
|
46
|
+
absolute_http_refs_count = 0
|
|
47
|
+
total_refs_count = 0
|
|
48
|
+
local_refs_count = 0
|
|
49
|
+
|
|
50
|
+
for path, _parent, key, value in iter_url_fields(root):
|
|
51
|
+
assert isinstance(key, str)
|
|
52
|
+
total_refs_count += 1
|
|
53
|
+
if key == "$ref" and is_fragment_only_uri(value):
|
|
54
|
+
local_refs_count += 1
|
|
55
|
+
continue
|
|
56
|
+
if _is_relative_like(value):
|
|
57
|
+
relative_refs_count += 1
|
|
58
|
+
elif not _is_relative_like(value) and is_http_https_url(value):
|
|
59
|
+
absolute_http_refs_count += 1
|
|
60
|
+
return total_refs_count, local_refs_count, relative_refs_count, absolute_http_refs_count
|
|
61
|
+
|
|
62
|
+
|
|
24
63
|
def find_relative_urls(root: Any) -> List[Tuple[JSONPath, str, str]]:
|
|
25
64
|
"""
|
|
26
65
|
Return a list of (json_path, key, value) for any URL-like field
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|