robotframework-openapitools 0.4.0__py3-none-any.whl → 1.0.0b1__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.
Files changed (60) hide show
  1. OpenApiDriver/__init__.py +44 -41
  2. OpenApiDriver/openapi_executors.py +40 -39
  3. OpenApiDriver/openapi_reader.py +115 -116
  4. OpenApiDriver/openapidriver.libspec +71 -61
  5. OpenApiDriver/openapidriver.py +25 -19
  6. OpenApiLibCore/__init__.py +13 -11
  7. OpenApiLibCore/annotations.py +3 -0
  8. OpenApiLibCore/data_generation/__init__.py +12 -0
  9. OpenApiLibCore/data_generation/body_data_generation.py +269 -0
  10. OpenApiLibCore/data_generation/data_generation_core.py +240 -0
  11. OpenApiLibCore/data_invalidation.py +281 -0
  12. OpenApiLibCore/dto_base.py +29 -35
  13. OpenApiLibCore/dto_utils.py +97 -85
  14. OpenApiLibCore/oas_cache.py +14 -13
  15. OpenApiLibCore/openapi_libcore.libspec +350 -193
  16. OpenApiLibCore/openapi_libcore.py +392 -1698
  17. OpenApiLibCore/parameter_utils.py +89 -0
  18. OpenApiLibCore/path_functions.py +215 -0
  19. OpenApiLibCore/path_invalidation.py +44 -0
  20. OpenApiLibCore/protocols.py +30 -0
  21. OpenApiLibCore/request_data.py +275 -0
  22. OpenApiLibCore/resource_relations.py +54 -0
  23. OpenApiLibCore/validation.py +497 -0
  24. OpenApiLibCore/value_utils.py +528 -481
  25. openapi_libgen/__init__.py +46 -0
  26. openapi_libgen/command_line.py +87 -0
  27. openapi_libgen/parsing_utils.py +26 -0
  28. openapi_libgen/spec_parser.py +212 -0
  29. openapi_libgen/templates/__init__.jinja +3 -0
  30. openapi_libgen/templates/library.jinja +30 -0
  31. robotframework_openapitools-1.0.0b1.dist-info/METADATA +237 -0
  32. robotframework_openapitools-1.0.0b1.dist-info/RECORD +37 -0
  33. {robotframework_openapitools-0.4.0.dist-info → robotframework_openapitools-1.0.0b1.dist-info}/WHEEL +1 -1
  34. robotframework_openapitools-1.0.0b1.dist-info/entry_points.txt +3 -0
  35. roboswag/__init__.py +0 -9
  36. roboswag/__main__.py +0 -3
  37. roboswag/auth.py +0 -44
  38. roboswag/cli.py +0 -80
  39. roboswag/core.py +0 -85
  40. roboswag/generate/__init__.py +0 -1
  41. roboswag/generate/generate.py +0 -121
  42. roboswag/generate/models/__init__.py +0 -0
  43. roboswag/generate/models/api.py +0 -219
  44. roboswag/generate/models/definition.py +0 -28
  45. roboswag/generate/models/endpoint.py +0 -68
  46. roboswag/generate/models/parameter.py +0 -25
  47. roboswag/generate/models/response.py +0 -8
  48. roboswag/generate/models/tag.py +0 -16
  49. roboswag/generate/models/utils.py +0 -60
  50. roboswag/generate/templates/api_init.jinja +0 -15
  51. roboswag/generate/templates/models.jinja +0 -7
  52. roboswag/generate/templates/paths.jinja +0 -68
  53. roboswag/logger.py +0 -33
  54. roboswag/validate/__init__.py +0 -6
  55. roboswag/validate/core.py +0 -3
  56. roboswag/validate/schema.py +0 -21
  57. roboswag/validate/text_response.py +0 -14
  58. robotframework_openapitools-0.4.0.dist-info/METADATA +0 -42
  59. robotframework_openapitools-0.4.0.dist-info/RECORD +0 -41
  60. {robotframework_openapitools-0.4.0.dist-info → robotframework_openapitools-1.0.0b1.dist-info}/LICENSE +0 -0
@@ -1,12 +1,12 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <keywordspec name="OpenApiDriver" type="LIBRARY" format="HTML" scope="SUITE" generated="2024-12-04T12:16:37+00:00" specversion="6" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapidriver.py" lineno="352">
3
- <version>0.4.0</version>
2
+ <keywordspec name="OpenApiDriver" type="LIBRARY" format="HTML" scope="SUITE" generated="2025-04-01T12:12:33+00:00" specversion="6" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapidriver.py" lineno="358">
3
+ <version>1.0.0b1</version>
4
4
  <doc>&lt;p&gt;Visit the &lt;a href="https://github.com/MarketSquare/robotframework-openapidriver"&gt;library page&lt;/a&gt; for an introduction and examples.&lt;/p&gt;</doc>
5
5
  <tags>
6
6
  </tags>
7
7
  <inits>
8
- <init name="__init__" lineno="144">
9
- <arguments repr="source: str, origin: str = , base_path: str = , included_paths: Iterable[str] | None = None, ignored_paths: Iterable[str] | None = None, ignored_responses: Iterable[int] | None = None, ignored_testcases: Iterable[Tuple[str, str, int]] | None = None, response_validation: ValidationLevel = WARN, disable_server_validation: bool = True, mappings_path: str | Path = , invalid_property_default_response: int = 422, default_id_property_name: str = id, faker_locale: str | List[str] | None = None, require_body_for_invalid_url: bool = False, recursion_limit: int = 1, recursion_default: Any = {}, username: str = , password: str = , security_token: str = , auth: AuthBase | None = None, cert: str | Tuple[str, str] | None = None, verify_tls: bool | str | None = True, extra_headers: Dict[str, str] | None = None, cookies: Dict[str, str] | RequestsCookieJar | None = None, proxies: Dict[str, str] | None = None">
8
+ <init name="__init__" lineno="150">
9
+ <arguments repr="source: str, origin: str = , base_path: str = , included_paths: Iterable[str] = frozenset(), ignored_paths: Iterable[str] = frozenset(), ignored_responses: Iterable[int] = frozenset(), ignored_testcases: Iterable[tuple[str, str, int]] = frozenset(), response_validation: ValidationLevel = WARN, disable_server_validation: bool = True, mappings_path: str | Path = , invalid_property_default_response: int = 422, default_id_property_name: str = id, faker_locale: str | list[str] = , require_body_for_invalid_url: bool = False, recursion_limit: int = 1, recursion_default: dict[str, JSON] | list[JSON] | str | bytes | int | float | bool | None = {}, username: str = , password: str = , security_token: str = , auth: AuthBase | None = None, cert: str | tuple[str, str] = , verify_tls: bool | str = True, extra_headers: Mapping[str, str] = {}, cookies: MutableMapping[str, str] | RequestsCookieJar | None = None, proxies: MutableMapping[str, str] | None = None">
10
10
  <arg kind="POSITIONAL_OR_NAMED" required="true" repr="source: str">
11
11
  <name>source</name>
12
12
  <type name="str" typedoc="string"/>
@@ -21,49 +21,37 @@
21
21
  <type name="str" typedoc="string"/>
22
22
  <default/>
23
23
  </arg>
24
- <arg kind="POSITIONAL_OR_NAMED" required="false" repr="included_paths: Iterable[str] | None = None">
24
+ <arg kind="POSITIONAL_OR_NAMED" required="false" repr="included_paths: Iterable[str] = frozenset()">
25
25
  <name>included_paths</name>
26
- <type name="Union" union="true">
27
26
  <type name="Iterable">
28
27
  <type name="str" typedoc="string"/>
29
28
  </type>
30
- <type name="None" typedoc="None"/>
31
- </type>
32
- <default>None</default>
29
+ <default>frozenset()</default>
33
30
  </arg>
34
- <arg kind="POSITIONAL_OR_NAMED" required="false" repr="ignored_paths: Iterable[str] | None = None">
31
+ <arg kind="POSITIONAL_OR_NAMED" required="false" repr="ignored_paths: Iterable[str] = frozenset()">
35
32
  <name>ignored_paths</name>
36
- <type name="Union" union="true">
37
33
  <type name="Iterable">
38
34
  <type name="str" typedoc="string"/>
39
35
  </type>
40
- <type name="None" typedoc="None"/>
41
- </type>
42
- <default>None</default>
36
+ <default>frozenset()</default>
43
37
  </arg>
44
- <arg kind="POSITIONAL_OR_NAMED" required="false" repr="ignored_responses: Iterable[int] | None = None">
38
+ <arg kind="POSITIONAL_OR_NAMED" required="false" repr="ignored_responses: Iterable[int] = frozenset()">
45
39
  <name>ignored_responses</name>
46
- <type name="Union" union="true">
47
40
  <type name="Iterable">
48
41
  <type name="int" typedoc="integer"/>
49
42
  </type>
50
- <type name="None" typedoc="None"/>
51
- </type>
52
- <default>None</default>
43
+ <default>frozenset()</default>
53
44
  </arg>
54
- <arg kind="POSITIONAL_OR_NAMED" required="false" repr="ignored_testcases: Iterable[Tuple[str, str, int]] | None = None">
45
+ <arg kind="POSITIONAL_OR_NAMED" required="false" repr="ignored_testcases: Iterable[tuple[str, str, int]] = frozenset()">
55
46
  <name>ignored_testcases</name>
56
- <type name="Union" union="true">
57
47
  <type name="Iterable">
58
- <type name="Tuple" typedoc="tuple">
48
+ <type name="tuple" typedoc="tuple">
59
49
  <type name="str" typedoc="string"/>
60
50
  <type name="str" typedoc="string"/>
61
51
  <type name="int" typedoc="integer"/>
62
52
  </type>
63
53
  </type>
64
- <type name="None" typedoc="None"/>
65
- </type>
66
- <default>None</default>
54
+ <default>frozenset()</default>
67
55
  </arg>
68
56
  <arg kind="POSITIONAL_OR_NAMED" required="false" repr="response_validation: ValidationLevel = WARN">
69
57
  <name>response_validation</name>
@@ -93,16 +81,15 @@
93
81
  <type name="str" typedoc="string"/>
94
82
  <default>id</default>
95
83
  </arg>
96
- <arg kind="POSITIONAL_OR_NAMED" required="false" repr="faker_locale: str | List[str] | None = None">
84
+ <arg kind="POSITIONAL_OR_NAMED" required="false" repr="faker_locale: str | list[str] = ">
97
85
  <name>faker_locale</name>
98
86
  <type name="Union" union="true">
99
87
  <type name="str" typedoc="string"/>
100
- <type name="List" typedoc="list">
88
+ <type name="list" typedoc="list">
101
89
  <type name="str" typedoc="string"/>
102
90
  </type>
103
- <type name="None" typedoc="None"/>
104
91
  </type>
105
- <default>None</default>
92
+ <default/>
106
93
  </arg>
107
94
  <arg kind="POSITIONAL_OR_NAMED" required="false" repr="require_body_for_invalid_url: bool = False">
108
95
  <name>require_body_for_invalid_url</name>
@@ -114,9 +101,23 @@
114
101
  <type name="int" typedoc="integer"/>
115
102
  <default>1</default>
116
103
  </arg>
117
- <arg kind="POSITIONAL_OR_NAMED" required="false" repr="recursion_default: Any = {}">
104
+ <arg kind="POSITIONAL_OR_NAMED" required="false" repr="recursion_default: dict[str, JSON] | list[JSON] | str | bytes | int | float | bool | None = {}">
118
105
  <name>recursion_default</name>
119
- <type name="Any" typedoc="Any"/>
106
+ <type name="Union" union="true">
107
+ <type name="dict" typedoc="dictionary">
108
+ <type name="str" typedoc="string"/>
109
+ <type name="JSON"/>
110
+ </type>
111
+ <type name="list" typedoc="list">
112
+ <type name="JSON"/>
113
+ </type>
114
+ <type name="str" typedoc="string"/>
115
+ <type name="bytes" typedoc="bytes"/>
116
+ <type name="int" typedoc="integer"/>
117
+ <type name="float" typedoc="float"/>
118
+ <type name="bool" typedoc="boolean"/>
119
+ <type name="None" typedoc="None"/>
120
+ </type>
120
121
  <default>{}</default>
121
122
  </arg>
122
123
  <arg kind="POSITIONAL_OR_NAMED" required="false" repr="username: str = ">
@@ -142,42 +143,37 @@
142
143
  </type>
143
144
  <default>None</default>
144
145
  </arg>
145
- <arg kind="POSITIONAL_OR_NAMED" required="false" repr="cert: str | Tuple[str, str] | None = None">
146
+ <arg kind="POSITIONAL_OR_NAMED" required="false" repr="cert: str | tuple[str, str] = ">
146
147
  <name>cert</name>
147
148
  <type name="Union" union="true">
148
149
  <type name="str" typedoc="string"/>
149
- <type name="Tuple" typedoc="tuple">
150
+ <type name="tuple" typedoc="tuple">
150
151
  <type name="str" typedoc="string"/>
151
152
  <type name="str" typedoc="string"/>
152
153
  </type>
153
- <type name="None" typedoc="None"/>
154
154
  </type>
155
- <default>None</default>
155
+ <default/>
156
156
  </arg>
157
- <arg kind="POSITIONAL_OR_NAMED" required="false" repr="verify_tls: bool | str | None = True">
157
+ <arg kind="POSITIONAL_OR_NAMED" required="false" repr="verify_tls: bool | str = True">
158
158
  <name>verify_tls</name>
159
159
  <type name="Union" union="true">
160
160
  <type name="bool" typedoc="boolean"/>
161
161
  <type name="str" typedoc="string"/>
162
- <type name="None" typedoc="None"/>
163
162
  </type>
164
163
  <default>True</default>
165
164
  </arg>
166
- <arg kind="POSITIONAL_OR_NAMED" required="false" repr="extra_headers: Dict[str, str] | None = None">
165
+ <arg kind="POSITIONAL_OR_NAMED" required="false" repr="extra_headers: Mapping[str, str] = {}">
167
166
  <name>extra_headers</name>
168
- <type name="Union" union="true">
169
- <type name="Dict" typedoc="dictionary">
167
+ <type name="Mapping" typedoc="dictionary">
170
168
  <type name="str" typedoc="string"/>
171
169
  <type name="str" typedoc="string"/>
172
170
  </type>
173
- <type name="None" typedoc="None"/>
174
- </type>
175
- <default>None</default>
171
+ <default>{}</default>
176
172
  </arg>
177
- <arg kind="POSITIONAL_OR_NAMED" required="false" repr="cookies: Dict[str, str] | RequestsCookieJar | None = None">
173
+ <arg kind="POSITIONAL_OR_NAMED" required="false" repr="cookies: MutableMapping[str, str] | RequestsCookieJar | None = None">
178
174
  <name>cookies</name>
179
175
  <type name="Union" union="true">
180
- <type name="Dict" typedoc="dictionary">
176
+ <type name="MutableMapping" typedoc="dictionary">
181
177
  <type name="str" typedoc="string"/>
182
178
  <type name="str" typedoc="string"/>
183
179
  </type>
@@ -186,10 +182,10 @@
186
182
  </type>
187
183
  <default>None</default>
188
184
  </arg>
189
- <arg kind="POSITIONAL_OR_NAMED" required="false" repr="proxies: Dict[str, str] | None = None">
185
+ <arg kind="POSITIONAL_OR_NAMED" required="false" repr="proxies: MutableMapping[str, str] | None = None">
190
186
  <name>proxies</name>
191
187
  <type name="Union" union="true">
192
- <type name="Dict" typedoc="dictionary">
188
+ <type name="MutableMapping" typedoc="dictionary">
193
189
  <type name="str" typedoc="string"/>
194
190
  <type name="str" typedoc="string"/>
195
191
  </type>
@@ -213,7 +209,7 @@
213
209
  &lt;h4&gt;ignored_responses&lt;/h4&gt;
214
210
  &lt;p&gt;A list of responses that will be ignored when generating the test cases.&lt;/p&gt;
215
211
  &lt;h4&gt;ignored_testcases&lt;/h4&gt;
216
- &lt;p&gt;A list of specific test cases that, if it would be generated, will be ignored. Specific test cases to ignore must be specified as a &lt;code&gt;Tuple&lt;/code&gt; or &lt;code&gt;List&lt;/code&gt; of &lt;code&gt;path&lt;/code&gt;, &lt;code&gt;method&lt;/code&gt; and &lt;code&gt;response&lt;/code&gt;.&lt;/p&gt;
212
+ &lt;p&gt;A list of specific test cases that, if it would be generated, will be ignored. Specific test cases to ignore must be specified as a &lt;code&gt;tuple&lt;/code&gt; or &lt;code&gt;list&lt;/code&gt; of &lt;code&gt;path&lt;/code&gt;, &lt;code&gt;method&lt;/code&gt; and &lt;code&gt;response&lt;/code&gt;.&lt;/p&gt;
217
213
  &lt;h4&gt;response_validation&lt;/h4&gt;
218
214
  &lt;p&gt;By default, a &lt;code&gt;WARN&lt;/code&gt; is logged when the Response received after a Request does not comply with the schema as defined in the openapi document for the given operation. The following values are supported:&lt;/p&gt;
219
215
  &lt;ul&gt;
@@ -265,7 +261,7 @@
265
261
  </init>
266
262
  </inits>
267
263
  <keywords>
268
- <kw name="Test Endpoint" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="161">
264
+ <kw name="Test Endpoint" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="162">
269
265
  <arguments repr="path: str, method: str, status_code: int">
270
266
  <arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
271
267
  <name>path</name>
@@ -285,7 +281,7 @@
285
281
  &lt;p&gt;The keyword calls other keywords to generate the neccesary data to perform the desired operation and validate the response against the openapi document.&lt;/p&gt;</doc>
286
282
  <shortdoc>Validate that performing the `method` operation on `path` results in a `status_code` response.</shortdoc>
287
283
  </kw>
288
- <kw name="Test Forbidden" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="97">
284
+ <kw name="Test Forbidden" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="98">
289
285
  <arguments repr="path: str, method: str">
290
286
  <arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
291
287
  <name>path</name>
@@ -301,7 +297,7 @@
301
297
  &lt;p&gt;For this keyword to pass, the authorization parameters used to initialize the library should grant insufficient access rights to the target endpoint. &amp;gt; Note: No headers or (json) body are send with the request. For security reasons, the access rights validation should be checked first.&lt;/p&gt;</doc>
302
298
  <shortdoc>Perform a request for `method` on the `path`, with the provided authorization.</shortdoc>
303
299
  </kw>
304
- <kw name="Test Invalid Url" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="114">
300
+ <kw name="Test Invalid Url" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="115">
305
301
  <arguments repr="path: str, method: str, expected_status_code: int = 404">
306
302
  <arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
307
303
  <name>path</name>
@@ -323,7 +319,7 @@
323
319
  &lt;p&gt;&amp;gt; Note: Depending on API design, the url may be validated before or after validation of headers, query parameters and / or (json) body. By default, no parameters are send with the request. The &lt;span class="name"&gt;require_body_for_invalid_url&lt;/span&gt; parameter can be set to &lt;span class="name"&gt;True&lt;/span&gt; if needed.&lt;/p&gt;</doc>
324
320
  <shortdoc>Perform a request for the provided 'path' and 'method' where the url for the `path` is invalidated.</shortdoc>
325
321
  </kw>
326
- <kw name="Test Unauthorized" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="76">
322
+ <kw name="Test Unauthorized" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="77">
327
323
  <arguments repr="path: str, method: str">
328
324
  <arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
329
325
  <name>path</name>
@@ -341,15 +337,6 @@
341
337
  </kw>
342
338
  </keywords>
343
339
  <typedocs>
344
- <type name="Any" type="Standard">
345
- <doc>&lt;p&gt;Any value is accepted. No conversion is done.&lt;/p&gt;</doc>
346
- <accepts>
347
- <type>Any</type>
348
- </accepts>
349
- <usages>
350
- <usage>__init__</usage>
351
- </usages>
352
- </type>
353
340
  <type name="boolean" type="Standard">
354
341
  <doc>&lt;p&gt;Strings &lt;code&gt;TRUE&lt;/code&gt;, &lt;code&gt;YES&lt;/code&gt;, &lt;code&gt;ON&lt;/code&gt; and &lt;code&gt;1&lt;/code&gt; are converted to Boolean &lt;code&gt;True&lt;/code&gt;, the empty string as well as strings &lt;code&gt;FALSE&lt;/code&gt;, &lt;code&gt;NO&lt;/code&gt;, &lt;code&gt;OFF&lt;/code&gt; and &lt;code&gt;0&lt;/code&gt; are converted to Boolean &lt;code&gt;False&lt;/code&gt;, and the string &lt;code&gt;NONE&lt;/code&gt; is converted to the Python &lt;code&gt;None&lt;/code&gt; object. Other strings and other accepted values are passed as-is, allowing keywords to handle them specially if needed. All string comparisons are case-insensitive.&lt;/p&gt;
355
342
  &lt;p&gt;Examples: &lt;code&gt;TRUE&lt;/code&gt; (converted to &lt;code&gt;True&lt;/code&gt;), &lt;code&gt;off&lt;/code&gt; (converted to &lt;code&gt;False&lt;/code&gt;), &lt;code&gt;example&lt;/code&gt; (used as-is)&lt;/p&gt;</doc>
@@ -363,6 +350,17 @@
363
350
  <usage>__init__</usage>
364
351
  </usages>
365
352
  </type>
353
+ <type name="bytes" type="Standard">
354
+ <doc>&lt;p&gt;Strings are converted to bytes so that each Unicode code point below 256 is directly mapped to a matching byte. Higher code points are not allowed. Robot Framework's &lt;code&gt;\xHH&lt;/code&gt; escape syntax is convenient with bytes having non-printable values.&lt;/p&gt;
355
+ &lt;p&gt;Examples: &lt;code&gt;good&lt;/code&gt;, &lt;code&gt;hyvä&lt;/code&gt; (same as &lt;code&gt;hyv\xE4&lt;/code&gt;), &lt;code&gt;\x00&lt;/code&gt; (the null byte)&lt;/p&gt;</doc>
356
+ <accepts>
357
+ <type>string</type>
358
+ <type>bytearray</type>
359
+ </accepts>
360
+ <usages>
361
+ <usage>__init__</usage>
362
+ </usages>
363
+ </type>
366
364
  <type name="dictionary" type="Standard">
367
365
  <doc>&lt;p&gt;Strings must be Python &lt;a href="https://docs.python.org/library/stdtypes.html#dict"&gt;dictionary&lt;/a&gt; literals. They are converted to actual dictionaries using the &lt;a href="https://docs.python.org/library/ast.html#ast.literal_eval"&gt;ast.literal_eval&lt;/a&gt; function. They can contain any values &lt;code&gt;ast.literal_eval&lt;/code&gt; supports, including dictionaries and other containers.&lt;/p&gt;
368
366
  &lt;p&gt;If the type has nested types like &lt;code&gt;dict[str, int]&lt;/code&gt;, items are converted to those types automatically. This in new in Robot Framework 6.0.&lt;/p&gt;
@@ -375,6 +373,18 @@
375
373
  <usage>__init__</usage>
376
374
  </usages>
377
375
  </type>
376
+ <type name="float" type="Standard">
377
+ <doc>&lt;p&gt;Conversion is done using Python's &lt;a href="https://docs.python.org/library/functions.html#float"&gt;float&lt;/a&gt; built-in function.&lt;/p&gt;
378
+ &lt;p&gt;Starting from RF 4.1, spaces and underscores can be used as visual separators for digit grouping purposes.&lt;/p&gt;
379
+ &lt;p&gt;Examples: &lt;code&gt;3.14&lt;/code&gt;, &lt;code&gt;2.9979e8&lt;/code&gt;, &lt;code&gt;10 000.000 01&lt;/code&gt;&lt;/p&gt;</doc>
380
+ <accepts>
381
+ <type>string</type>
382
+ <type>Real</type>
383
+ </accepts>
384
+ <usages>
385
+ <usage>__init__</usage>
386
+ </usages>
387
+ </type>
378
388
  <type name="integer" type="Standard">
379
389
  <doc>&lt;p&gt;Conversion is done using Python's &lt;a href="https://docs.python.org/library/functions.html#int"&gt;int&lt;/a&gt; built-in function. Floating point numbers are accepted only if they can be represented as integers exactly. For example, &lt;code&gt;1.0&lt;/code&gt; is accepted and &lt;code&gt;1.1&lt;/code&gt; is not.&lt;/p&gt;
380
390
  &lt;p&gt;Starting from RF 4.1, it is possible to use hexadecimal, octal and binary numbers by prefixing values with &lt;code&gt;0x&lt;/code&gt;, &lt;code&gt;0o&lt;/code&gt; and &lt;code&gt;0b&lt;/code&gt;, respectively.&lt;/p&gt;
@@ -122,16 +122,22 @@ data types and properties. The following list details the most important ones:
122
122
 
123
123
  """
124
124
 
125
+ from collections.abc import Mapping, MutableMapping
125
126
  from pathlib import Path
126
- from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
127
+ from types import MappingProxyType
128
+ from typing import Iterable
127
129
 
128
- from DataDriver import DataDriver
130
+ from DataDriver.DataDriver import DataDriver
129
131
  from requests.auth import AuthBase
130
132
  from requests.cookies import RequestsCookieJar as CookieJar
131
133
  from robot.api.deco import library
132
134
 
133
- from OpenApiDriver.openapi_executors import OpenApiExecutors, ValidationLevel
135
+ from OpenApiDriver.openapi_executors import OpenApiExecutors
134
136
  from OpenApiDriver.openapi_reader import OpenApiReader
137
+ from OpenApiLibCore import ValidationLevel
138
+ from OpenApiLibCore.annotations import JSON
139
+
140
+ default_str_mapping: Mapping[str, str] = MappingProxyType({})
135
141
 
136
142
 
137
143
  @library(scope="SUITE", doc_format="ROBOT")
@@ -141,33 +147,33 @@ class OpenApiDriver(OpenApiExecutors, DataDriver):
141
147
  for an introduction and examples.
142
148
  """
143
149
 
144
- def __init__( # pylint: disable=too-many-arguments, too-many-locals, dangerous-default-value
150
+ def __init__( # noqa: PLR0913, pylint: disable=dangerous-default-value
145
151
  self,
146
152
  source: str,
147
153
  origin: str = "",
148
154
  base_path: str = "",
149
- included_paths: Optional[Iterable[str]] = None,
150
- ignored_paths: Optional[Iterable[str]] = None,
151
- ignored_responses: Optional[Iterable[int]] = None,
152
- ignored_testcases: Optional[Iterable[Tuple[str, str, int]]] = None,
155
+ included_paths: Iterable[str] = frozenset(),
156
+ ignored_paths: Iterable[str] = frozenset(),
157
+ ignored_responses: Iterable[int] = frozenset(),
158
+ ignored_testcases: Iterable[tuple[str, str, int]] = frozenset(),
153
159
  response_validation: ValidationLevel = ValidationLevel.WARN,
154
160
  disable_server_validation: bool = True,
155
- mappings_path: Union[str, Path] = "",
161
+ mappings_path: str | Path = "",
156
162
  invalid_property_default_response: int = 422,
157
163
  default_id_property_name: str = "id",
158
- faker_locale: Optional[Union[str, List[str]]] = None,
164
+ faker_locale: str | list[str] = "",
159
165
  require_body_for_invalid_url: bool = False,
160
166
  recursion_limit: int = 1,
161
- recursion_default: Any = {},
167
+ recursion_default: JSON = {},
162
168
  username: str = "",
163
169
  password: str = "",
164
170
  security_token: str = "",
165
- auth: Optional[AuthBase] = None,
166
- cert: Optional[Union[str, Tuple[str, str]]] = None,
167
- verify_tls: Optional[Union[bool, str]] = True,
168
- extra_headers: Optional[Dict[str, str]] = None,
169
- cookies: Optional[Union[Dict[str, str], CookieJar]] = None,
170
- proxies: Optional[Dict[str, str]] = None,
171
+ auth: AuthBase | None = None,
172
+ cert: str | tuple[str, str] = "",
173
+ verify_tls: bool | str = True,
174
+ extra_headers: Mapping[str, str] = default_str_mapping,
175
+ cookies: MutableMapping[str, str] | CookieJar | None = None,
176
+ proxies: MutableMapping[str, str] | None = None,
171
177
  ):
172
178
  """
173
179
  == Base parameters ==
@@ -200,7 +206,7 @@ class OpenApiDriver(OpenApiExecutors, DataDriver):
200
206
 
201
207
  === ignored_testcases ===
202
208
  A list of specific test cases that, if it would be generated, will be ignored.
203
- Specific test cases to ignore must be specified as a ``Tuple`` or ``List``
209
+ Specific test cases to ignore must be specified as a ``tuple`` or ``list``
204
210
  of ``path``, ``method`` and ``response``.
205
211
 
206
212
  === response_validation ===
@@ -353,7 +359,7 @@ class DocumentationGenerator(OpenApiDriver):
353
359
  __doc__ = OpenApiDriver.__doc__
354
360
 
355
361
  @staticmethod
356
- def get_keyword_names() -> List[str]:
362
+ def get_keyword_names() -> list[str]:
357
363
  """Curated keywords for libdoc and libspec."""
358
364
  return [
359
365
  "test_unauthorized",
@@ -1,3 +1,4 @@
1
+ # pylint: disable=invalid-name
1
2
  """
2
3
  The OpenApiLibCore package is intended to be used as a dependency for other
3
4
  Robot Framework libraries that facilitate the testing of OpenAPI / Swagger APIs.
@@ -18,37 +19,38 @@ from OpenApiLibCore.dto_base import (
18
19
  IdReference,
19
20
  PathPropertiesConstraint,
20
21
  PropertyValueConstraint,
21
- Relation,
22
+ ResourceRelation,
22
23
  UniquePropertyValueConstraint,
23
24
  resolve_schema,
24
25
  )
25
26
  from OpenApiLibCore.dto_utils import DefaultDto
26
27
  from OpenApiLibCore.openapi_libcore import (
27
28
  OpenApiLibCore,
28
- RequestData,
29
- RequestValues,
30
- ValidationLevel,
31
29
  )
32
- from OpenApiLibCore.value_utils import IGNORE
30
+ from OpenApiLibCore.request_data import RequestData, RequestValues
31
+ from OpenApiLibCore.validation import ValidationLevel
32
+ from OpenApiLibCore.value_utils import IGNORE, UNSET
33
33
 
34
34
  try:
35
35
  __version__ = version("robotframework-openapi-libcore")
36
- except Exception: # pragma: no cover
36
+ except Exception: # pragma: no cover pylint: disable=broad-exception-caught
37
37
  pass
38
38
 
39
+
39
40
  __all__ = [
41
+ "IGNORE",
42
+ "UNSET",
43
+ "DefaultDto",
40
44
  "Dto",
41
45
  "IdDependency",
42
46
  "IdReference",
47
+ "OpenApiLibCore",
43
48
  "PathPropertiesConstraint",
44
49
  "PropertyValueConstraint",
45
- "Relation",
46
- "UniquePropertyValueConstraint",
47
- "DefaultDto",
48
- "OpenApiLibCore",
49
50
  "RequestData",
50
51
  "RequestValues",
52
+ "ResourceRelation",
53
+ "UniquePropertyValueConstraint",
51
54
  "ValidationLevel",
52
55
  "resolve_schema",
53
- "IGNORE",
54
56
  ]
@@ -0,0 +1,3 @@
1
+ """Module holding reusable compound annotations."""
2
+
3
+ JSON = dict[str, "JSON"] | list["JSON"] | str | bytes | int | float | bool | None
@@ -0,0 +1,12 @@
1
+ """
2
+ Module holding the functions related to data generation
3
+ for the requests made as part of keyword exection.
4
+ """
5
+
6
+ from .body_data_generation import get_json_data_for_dto_class
7
+ from .data_generation_core import get_request_data
8
+
9
+ __all__ = [
10
+ "get_json_data_for_dto_class",
11
+ "get_request_data",
12
+ ]