robotframework-openapitools 1.0.0b4__py3-none-any.whl → 1.0.1__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.
- OpenApiDriver/__init__.py +1 -0
- OpenApiDriver/openapi_executors.py +32 -4
- OpenApiDriver/openapidriver.libspec +183 -80
- OpenApiDriver/openapidriver.py +8 -279
- OpenApiLibCore/__init__.py +26 -0
- OpenApiLibCore/data_generation/__init__.py +0 -0
- OpenApiLibCore/data_generation/body_data_generation.py +4 -4
- OpenApiLibCore/data_generation/data_generation_core.py +18 -45
- OpenApiLibCore/data_invalidation.py +1 -5
- OpenApiLibCore/dto_base.py +31 -22
- OpenApiLibCore/dto_utils.py +31 -3
- OpenApiLibCore/localized_faker.py +0 -0
- OpenApiLibCore/models.py +26 -18
- OpenApiLibCore/openapi_libcore.libspec +229 -121
- OpenApiLibCore/openapi_libcore.py +45 -274
- OpenApiLibCore/parameter_utils.py +3 -3
- OpenApiLibCore/path_functions.py +5 -6
- OpenApiLibCore/path_invalidation.py +5 -7
- OpenApiLibCore/protocols.py +6 -0
- OpenApiLibCore/request_data.py +0 -0
- OpenApiLibCore/resource_relations.py +4 -2
- OpenApiLibCore/validation.py +4 -9
- OpenApiLibCore/value_utils.py +1 -1
- openapi_libgen/__init__.py +3 -0
- openapi_libgen/generator.py +2 -4
- openapi_libgen/parsing_utils.py +9 -5
- openapi_libgen/spec_parser.py +4 -4
- openapitools_docs/__init__.py +0 -0
- openapitools_docs/docstrings.py +891 -0
- openapitools_docs/documentation_generator.py +35 -0
- openapitools_docs/templates/documentation.jinja +209 -0
- {robotframework_openapitools-1.0.0b4.dist-info → robotframework_openapitools-1.0.1.dist-info}/METADATA +16 -98
- robotframework_openapitools-1.0.1.dist-info/RECORD +44 -0
- robotframework_openapitools-1.0.0b4.dist-info/RECORD +0 -40
- {robotframework_openapitools-1.0.0b4.dist-info → robotframework_openapitools-1.0.1.dist-info}/LICENSE +0 -0
- {robotframework_openapitools-1.0.0b4.dist-info → robotframework_openapitools-1.0.1.dist-info}/WHEEL +0 -0
- {robotframework_openapitools-1.0.0b4.dist-info → robotframework_openapitools-1.0.1.dist-info}/entry_points.txt +0 -0
openapi_libgen/generator.py
CHANGED
@@ -8,8 +8,6 @@ from openapi_libgen.spec_parser import get_keyword_data
|
|
8
8
|
from OpenApiLibCore.models import OpenApiObject
|
9
9
|
|
10
10
|
HERE = Path(__file__).parent.resolve()
|
11
|
-
INIT_TEMPLATE_PATH = HERE / "templates/__init__.jinja"
|
12
|
-
LIBRARY_TEMPLATE_PATH = HERE / "templates/library.jinja"
|
13
11
|
|
14
12
|
|
15
13
|
def load_openapi_spec(
|
@@ -18,7 +16,7 @@ def load_openapi_spec(
|
|
18
16
|
def recursion_limit_handler(
|
19
17
|
limit: int, refstring: str, recursions: object
|
20
18
|
) -> object: # pylint: disable=unused-argument
|
21
|
-
return recursion_default
|
19
|
+
return recursion_default # pragma: no cover
|
22
20
|
|
23
21
|
parser = ResolvingParser(
|
24
22
|
source,
|
@@ -69,7 +67,7 @@ def generate(
|
|
69
67
|
return f"Generated {library_name} at {output_folder.resolve().as_posix()}/{module_name}"
|
70
68
|
|
71
69
|
|
72
|
-
if __name__ == "__main__":
|
70
|
+
if __name__ == "__main__": # pragma: no cover
|
73
71
|
source = sys.argv[1]
|
74
72
|
destination = Path(sys.argv[2])
|
75
73
|
library_name = sys.argv[3]
|
openapi_libgen/parsing_utils.py
CHANGED
@@ -8,16 +8,20 @@ def remove_unsafe_characters_from_string(string: str) -> str:
|
|
8
8
|
string_iterator = iter(string)
|
9
9
|
capitalize_next_character = False
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
# The first character must be A-z or _
|
12
|
+
first_character = next(string_iterator, "_")
|
13
|
+
if first_character.isalpha() or first_character == "_":
|
14
|
+
yield first_character
|
15
|
+
elif first_character.isnumeric():
|
16
|
+
yield "_" + first_character
|
15
17
|
|
16
18
|
for character in string_iterator:
|
17
19
|
if character.isalnum():
|
18
20
|
if capitalize_next_character:
|
19
21
|
capitalize_next_character = False
|
20
|
-
|
22
|
+
yield character.upper()
|
23
|
+
else:
|
24
|
+
yield character
|
21
25
|
|
22
26
|
elif not capitalize_next_character:
|
23
27
|
capitalize_next_character = True
|
openapi_libgen/spec_parser.py
CHANGED
@@ -79,7 +79,7 @@ def get_keyword_signature(operation_details: OperationDetails) -> str:
|
|
79
79
|
else:
|
80
80
|
keyword_name = remove_unsafe_characters_from_string(
|
81
81
|
f"{operation_details.method}_{operation_details.path}"
|
82
|
-
)
|
82
|
+
).lower()
|
83
83
|
|
84
84
|
parameters = operation_details.parameters or []
|
85
85
|
path_parameters = [p for p in parameters if p.in_ == "path" and p.schema_]
|
@@ -93,7 +93,7 @@ def get_keyword_signature(operation_details: OperationDetails) -> str:
|
|
93
93
|
keyword_argument_names: set[str] = set()
|
94
94
|
|
95
95
|
for parameter in path_parameters:
|
96
|
-
annotation = f"{parameter.schema_.annotation_string} = UNSET"
|
96
|
+
annotation = f"{parameter.schema_.annotation_string} = UNSET" # type: ignore[union-attr]
|
97
97
|
safe_name = get_safe_name_for_oas_name(parameter.name)
|
98
98
|
keyword_argument_names.add(safe_name)
|
99
99
|
argument = f", {safe_name}: {annotation}"
|
@@ -120,7 +120,7 @@ def get_keyword_signature(operation_details: OperationDetails) -> str:
|
|
120
120
|
arguments += argument
|
121
121
|
|
122
122
|
for parameter in query_parameters:
|
123
|
-
annotation = f"{parameter.schema_.annotation_string} = UNSET"
|
123
|
+
annotation = f"{parameter.schema_.annotation_string} = UNSET" # type: ignore[union-attr]
|
124
124
|
safe_name = get_safe_name_for_oas_name(parameter.name)
|
125
125
|
if safe_name in keyword_argument_names:
|
126
126
|
safe_name = "query_" + safe_name
|
@@ -129,7 +129,7 @@ def get_keyword_signature(operation_details: OperationDetails) -> str:
|
|
129
129
|
arguments += argument
|
130
130
|
|
131
131
|
for parameter in header_parameters:
|
132
|
-
annotation = f"{parameter.schema_.annotation_string} = UNSET"
|
132
|
+
annotation = f"{parameter.schema_.annotation_string} = UNSET" # type: ignore[union-attr]
|
133
133
|
safe_name = get_safe_name_for_oas_name(parameter.name)
|
134
134
|
if safe_name in keyword_argument_names:
|
135
135
|
safe_name = "header_" + safe_name
|
File without changes
|