|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | | -<keywordspec name="OpenApiLibCore" type="LIBRARY" format="HTML" scope="SUITE" generated="2024-08-09T12:54:30+00:00" specversion="6" source="/workspaces/robotframework-openapitools/src/OpenApiLibCore/openapi_libcore.py" lineno="431"> |
3 | | -<version>0.3.0</version> |
| 2 | +<keywordspec name="OpenApiLibCore" type="LIBRARY" format="HTML" scope="SUITE" generated="2024-12-04T12:16:36+00:00" specversion="6" source="/workspaces/robotframework-openapitools/src/OpenApiLibCore/openapi_libcore.py" lineno="457"> |
| 3 | +<version>0.4.0</version> |
4 | 4 | <doc><p>Main class providing the keywords and core logic to interact with an OpenAPI server.</p> |
5 | 5 | <p>Visit the <a href="https://github.com/MarketSquare/robotframework-openapi-libcore">library page</a> for an introduction.</p></doc> |
6 | 6 | <tags> |
7 | 7 | </tags> |
8 | 8 | <inits> |
9 | | -<init name="__init__" lineno="439"> |
| 9 | +<init name="__init__" lineno="465"> |
10 | 10 | <arguments repr="source: str, origin: str = , base_path: str = , 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"> |
11 | 11 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="source: str"> |
12 | 12 | <name>source</name> |
|
214 | 214 | </init> |
215 | 215 | </inits> |
216 | 216 | <keywords> |
217 | | -<kw name="Authorized Request" lineno="1683"> |
| 217 | +<kw name="Authorized Request" lineno="1731"> |
218 | 218 | <arguments repr="url: str, method: str, params: Dict[str, Any] | None = None, headers: Dict[str, str] | None = None, json_data: Dict[str, Dict[str, JSON] | List[JSON] | str | int | float | bool | None] | List[Dict[str, JSON] | List[JSON] | str | int | float | bool | None] | str | int | float | bool | None = None, data: Any = None, files: Any = None"> |
219 | 219 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str"> |
220 | 220 | <name>url</name> |
|
307 | 307 | <p>&gt; Note: provided username / password or auth objects take precedence over token based security</p></doc> |
308 | 308 | <shortdoc>Perform a request using the security token or authentication set in the library.</shortdoc> |
309 | 309 | </kw> |
310 | | -<kw name="Ensure In Use" lineno="1587"> |
| 310 | +<kw name="Ensure In Use" lineno="1635"> |
311 | 311 | <arguments repr="url: str, resource_relation: IdReference"> |
312 | 312 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str"> |
313 | 313 | <name>url</name> |
|
321 | 321 | <doc><p>Ensure that the (right-most) <span class="name">id</span> of the resource referenced by the <span class="name">url</span> is used by the resource defined by the <span class="name">resource_relation</span>.</p></doc> |
322 | 322 | <shortdoc>Ensure that the (right-most) `id` of the resource referenced by the `url` is used by the resource defined by the `resource_relation`.</shortdoc> |
323 | 323 | </kw> |
324 | | -<kw name="Get Ids From Url" lineno="958"> |
| 324 | +<kw name="Get Ids From Url" lineno="984"> |
325 | 325 | <arguments repr="url: str"> |
326 | 326 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str"> |
327 | 327 | <name>url</name> |
|
334 | 334 | <doc><p>Perform a GET request on the <span class="name">url</span> and return the list of resource <span class="name">ids</span> from the response.</p></doc> |
335 | 335 | <shortdoc>Perform a GET request on the `url` and return the list of resource `ids` from the response.</shortdoc> |
336 | 336 | </kw> |
337 | | -<kw name="Get Invalid Json Data" lineno="1364"> |
| 337 | +<kw name="Get Invalid Json Data" lineno="1409"> |
338 | 338 | <arguments repr="url: str, method: str, status_code: int, request_data: RequestData"> |
339 | 339 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str"> |
340 | 340 | <name>url</name> |
|
361 | 361 | <p>&gt; Note: applicable UniquePropertyValueConstraint and IdReference Relations are considered before changes to <span class="name">json_data</span> are made.</p></doc> |
362 | 362 | <shortdoc>Return `json_data` based on the `dto` on the `request_data` that will cause the provided `status_code` for the `method` operation on the `url`.</shortdoc> |
363 | 363 | </kw> |
364 | | -<kw name="Get Invalidated Parameters" lineno="1412"> |
| 364 | +<kw name="Get Invalidated Parameters" lineno="1460"> |
365 | 365 | <arguments repr="status_code: int, request_data: RequestData"> |
366 | 366 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="status_code: int"> |
367 | 367 | <name>status_code</name> |
|
385 | 385 | <doc><p>Returns a version of <span class="name">params, headers</span> as present on <span class="name">request_data</span> that has been modified to cause the provided <span class="name">status_code</span>.</p></doc> |
386 | 386 | <shortdoc>Returns a version of `params, headers` as present on `request_data` that has been modified to cause the provided `status_code`.</shortdoc> |
387 | 387 | </kw> |
388 | | -<kw name="Get Invalidated Url" lineno="1330"> |
389 | | -<arguments repr="valid_url: str"> |
| 388 | +<kw name="Get Invalidated Url" lineno="1356"> |
| 389 | +<arguments repr="valid_url: str, path: str = , method: str = , expected_status_code: int = 404"> |
390 | 390 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="valid_url: str"> |
391 | 391 | <name>valid_url</name> |
392 | 392 | <type name="str" typedoc="string"/> |
393 | 393 | </arg> |
| 394 | +<arg kind="POSITIONAL_OR_NAMED" required="false" repr="path: str = "> |
| 395 | +<name>path</name> |
| 396 | +<type name="str" typedoc="string"/> |
| 397 | +<default/> |
| 398 | +</arg> |
| 399 | +<arg kind="POSITIONAL_OR_NAMED" required="false" repr="method: str = "> |
| 400 | +<name>method</name> |
| 401 | +<type name="str" typedoc="string"/> |
| 402 | +<default/> |
| 403 | +</arg> |
| 404 | +<arg kind="POSITIONAL_OR_NAMED" required="false" repr="expected_status_code: int = 404"> |
| 405 | +<name>expected_status_code</name> |
| 406 | +<type name="int" typedoc="integer"/> |
| 407 | +<default>404</default> |
| 408 | +</arg> |
394 | 409 | </arguments> |
395 | 410 | <returntype name="Union" union="true"> |
396 | 411 | <type name="str" typedoc="string"/> |
397 | 412 | <type name="None" typedoc="None"/> |
398 | 413 | </returntype> |
399 | | -<doc><p>Return an url with all the path parameters in the <span class="name">valid_url</span> replaced by a random UUID.</p> |
| 414 | +<doc><p>Return an url with all the path parameters in the <span class="name">valid_url</span> replaced by a random UUID if no PathPropertiesConstraint is mapped for the <a href="#type-Path" class="name">path</a>, <span class="name">method</span> and <span class="name">expected_status_code</span>. If a PathPropertiesConstraint is mapped, the <span class="name">invalid_value</span> is returned.</p> |
400 | 415 | <p>Raises ValueError if the valid_url cannot be invalidated.</p></doc> |
401 | | -<shortdoc>Return an url with all the path parameters in the `valid_url` replaced by a random UUID.</shortdoc> |
| 416 | +<shortdoc>Return an url with all the path parameters in the `valid_url` replaced by a random UUID if no PathPropertiesConstraint is mapped for the `path`, `method` and `expected_status_code`. If a PathPropertiesConstraint is mapped, the `invalid_value` is returned.</shortdoc> |
402 | 417 | </kw> |
403 | | -<kw name="Get Json Data For Dto Class" lineno="1206"> |
| 418 | +<kw name="Get Json Data For Dto Class" lineno="1232"> |
404 | 419 | <arguments repr="schema: Dict[str, Any], dto_class: Dto | Type[Dto], operation_id: str = "> |
405 | 420 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="schema: Dict[str, Any]"> |
406 | 421 | <name>schema</name> |
|
434 | 449 | <doc><p>Generate a valid (json-compatible) dict for all the <span class="name">dto_class</span> properties.</p></doc> |
435 | 450 | <shortdoc>Generate a valid (json-compatible) dict for all the `dto_class` properties.</shortdoc> |
436 | 451 | </kw> |
437 | | -<kw name="Get Json Data With Conflict" lineno="1631"> |
| 452 | +<kw name="Get Json Data With Conflict" lineno="1679"> |
438 | 453 | <arguments repr="url: str, method: str, dto: Dto, conflict_status_code: int"> |
439 | 454 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str"> |
440 | 455 | <name>url</name> |
|
460 | 475 | <doc><p>Return <span class="name">json_data</span> based on the <span class="name">UniquePropertyValueConstraint</span> that must be returned by the <span class="name">get_relations</span> implementation on the <span class="name">dto</span> for the given <span class="name">conflict_status_code</span>.</p></doc> |
461 | 476 | <shortdoc>Return `json_data` based on the `UniquePropertyValueConstraint` that must be returned by the `get_relations` implementation on the `dto` for the given `conflict_status_code`.</shortdoc> |
462 | 477 | </kw> |
463 | | -<kw name="Get Parameterized Endpoint From Url" lineno="1352"> |
| 478 | +<kw name="Get Parameterized Endpoint From Url" lineno="1397"> |
464 | 479 | <arguments repr="url: str"> |
465 | 480 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str"> |
466 | 481 | <name>url</name> |
|
471 | 486 | <doc><p>Return the endpoint as found in the <span class="name">paths</span> section based on the given <span class="name">url</span>.</p></doc> |
472 | 487 | <shortdoc>Return the endpoint as found in the `paths` section based on the given `url`.</shortdoc> |
473 | 488 | </kw> |
474 | | -<kw name="Get Request Data" lineno="998"> |
| 489 | +<kw name="Get Request Data" lineno="1024"> |
475 | 490 | <arguments repr="endpoint: str, method: str"> |
476 | 491 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="endpoint: str"> |
477 | 492 | <name>endpoint</name> |
|
486 | 501 | <doc><p>Return an object with valid request data for body, headers and query params.</p></doc> |
487 | 502 | <shortdoc>Return an object with valid request data for body, headers and query params.</shortdoc> |
488 | 503 | </kw> |
489 | | -<kw name="Get Valid Id For Endpoint" lineno="862"> |
| 504 | +<kw name="Get Valid Id For Endpoint" lineno="888"> |
490 | 505 | <arguments repr="endpoint: str, method: str"> |
491 | 506 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="endpoint: str"> |
492 | 507 | <name>endpoint</name> |
|
506 | 521 | <p>To prevent resource conflicts with other test cases, a new resource is created (POST) if possible.</p></doc> |
507 | 522 | <shortdoc>Support keyword that returns the `id` for an existing resource at `endpoint`.</shortdoc> |
508 | 523 | </kw> |
509 | | -<kw name="Get Valid Url" lineno="822"> |
| 524 | +<kw name="Get Valid Url" lineno="848"> |
510 | 525 | <arguments repr="endpoint: str, method: str"> |
511 | 526 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="endpoint: str"> |
512 | 527 | <name>endpoint</name> |
|
523 | 538 | <p>&gt; Note: if valid ids cannot be retrieved within the scope of the API, the <span class="name">PathPropertiesConstraint</span> Relation can be used. More information can be found <a href="https://marketsquare.github.io/robotframework-openapi-libcore/advanced_use.html">here</a>.</p></doc> |
524 | 539 | <shortdoc>This keyword returns a valid url for the given `endpoint` and `method`.</shortdoc> |
525 | 540 | </kw> |
526 | | -<kw name="Perform Validated Request" lineno="1730"> |
| 541 | +<kw name="Perform Validated Request" lineno="1778"> |
527 | 542 | <arguments repr="path: str, status_code: int, request_values: RequestValues, original_data: Dict[str, Any] | None = None"> |
528 | 543 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str"> |
529 | 544 | <name>path</name> |
|
552 | 567 | <doc><p>This keyword first calls the Authorized Request keyword, then the Validate Response keyword and finally validates, for <span class="name">DELETE</span> operations, whether the target resource was indeed deleted (OK response) or not (error responses).</p></doc> |
553 | 568 | <shortdoc>This keyword first calls the Authorized Request keyword, then the Validate Response keyword and finally validates, for `DELETE` operations, whether the target resource was indeed deleted (OK response) or not (error responses).</shortdoc> |
554 | 569 | </kw> |
555 | | -<kw name="Set Auth" lineno="677"> |
| 570 | +<kw name="Set Auth" lineno="703"> |
556 | 571 | <arguments repr="auth: AuthBase"> |
557 | 572 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="auth: AuthBase"> |
558 | 573 | <name>auth</name> |
|
563 | 578 | <p>After calling this keyword, subsequent requests will use the provided <span class="name">auth</span> instance.</p></doc> |
564 | 579 | <shortdoc>Set the `auth` used for authentication after the library is imported.</shortdoc> |
565 | 580 | </kw> |
566 | | -<kw name="Set Basic Auth" lineno="665"> |
| 581 | +<kw name="Set Basic Auth" lineno="691"> |
567 | 582 | <arguments repr="username: str, password: str"> |
568 | 583 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="username: str"> |
569 | 584 | <name>username</name> |
|
578 | 593 | <p>After calling this keyword, subsequent requests will use the provided credentials.</p></doc> |
579 | 594 | <shortdoc>Set the `username` and `password` used for basic authentication after the library is imported.</shortdoc> |
580 | 595 | </kw> |
581 | | -<kw name="Set Extra Headers" lineno="687"> |
| 596 | +<kw name="Set Extra Headers" lineno="713"> |
582 | 597 | <arguments repr="extra_headers: Dict[str, str]"> |
583 | 598 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="extra_headers: Dict[str, str]"> |
584 | 599 | <name>extra_headers</name> |
|
592 | 607 | <p>After calling this keyword, subsequent requests will use the provided <span class="name">extra_headers</span>.</p></doc> |
593 | 608 | <shortdoc>Set the `extra_headers` used in requests after the library is imported.</shortdoc> |
594 | 609 | </kw> |
595 | | -<kw name="Set Origin" lineno="642"> |
| 610 | +<kw name="Set Origin" lineno="668"> |
596 | 611 | <arguments repr="origin: str"> |
597 | 612 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="origin: str"> |
598 | 613 | <name>origin</name> |
|
604 | 619 | <p>In combination with OpenApiLibCore, the <span class="name">origin</span> can be used at any point to target another server that hosts an API that complies to the same OAS.</p></doc> |
605 | 620 | <shortdoc>Set the `origin` after the library is imported.</shortdoc> |
606 | 621 | </kw> |
607 | | -<kw name="Set Security Token" lineno="656"> |
| 622 | +<kw name="Set Security Token" lineno="682"> |
608 | 623 | <arguments repr="security_token: str"> |
609 | 624 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="security_token: str"> |
610 | 625 | <name>security_token</name> |
|
615 | 630 | <p>After calling this keyword, subsequent requests will use the provided token.</p></doc> |
616 | 631 | <shortdoc>Set the `security_token` after the library is imported.</shortdoc> |
617 | 632 | </kw> |
618 | | -<kw name="Validate Resource Properties" lineno="1966"> |
| 633 | +<kw name="Validate Resource Properties" lineno="2019"> |
619 | 634 | <arguments repr="resource: Dict[str, Any], schema: Dict[str, Any]"> |
620 | 635 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="resource: Dict[str, Any]"> |
621 | 636 | <name>resource</name> |
|
635 | 650 | <doc><p>Validate that the <span class="name">resource</span> does not contain any properties that are not defined in the <span class="name">schema_properties</span>.</p></doc> |
636 | 651 | <shortdoc>Validate that the `resource` does not contain any properties that are not defined in the `schema_properties`.</shortdoc> |
637 | 652 | </kw> |
638 | | -<kw name="Validate Response" lineno="1804"> |
| 653 | +<kw name="Validate Response" lineno="1852"> |
639 | 654 | <arguments repr="path: str, response: Response, original_data: Dict[str, Any] | None = None"> |
640 | 655 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str"> |
641 | 656 | <name>path</name> |
|
668 | 683 | </ul></doc> |
669 | 684 | <shortdoc>Validate the `response` by performing the following validations: - validate the `response` against the openapi schema for the `endpoint` - validate that the response does not contain extra properties - validate that a href, if present, refers to the correct resource - validate that the value for a property that is in the response is equal to the property value that was send - validate that no `original_data` is preserved when performing a PUT operation - validate that a PATCH operation only updates the provided properties</shortdoc> |
670 | 685 | </kw> |
671 | | -<kw name="Validate Send Response" lineno="2084"> |
| 686 | +<kw name="Validate Send Response" lineno="2137"> |
672 | 687 | <arguments repr="response: Response, original_data: Dict[str, Any] | None = None"> |
673 | 688 | <arg kind="POSITIONAL_OR_NAMED" required="true" repr="response: Response"> |
674 | 689 | <name>response</name> |
|
772 | 787 | <usage>Authorized Request</usage> |
773 | 788 | <usage>Get Invalid Json Data</usage> |
774 | 789 | <usage>Get Invalidated Parameters</usage> |
| 790 | +<usage>Get Invalidated Url</usage> |
775 | 791 | <usage>Get Json Data With Conflict</usage> |
776 | 792 | <usage>Get Valid Id For Endpoint</usage> |
777 | 793 | <usage>Perform Validated Request</usage> |
|
0 commit comments