Skip to content

Commit c3545fd

Browse files
committed
Version bump to 0.4.0, updated documentation
1 parent af38547 commit c3545fd

File tree

5 files changed

+52
-36
lines changed

5 files changed

+52
-36
lines changed

docs/openapi_libcore.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

docs/openapidriver.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name="robotframework-openapitools"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
description = "A set of Robot Framework libraries to test APIs for which the OAS is available."
55
license = "Apache-2.0"
66
authors = [

src/OpenApiDriver/openapidriver.libspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<keywordspec name="OpenApiDriver" type="LIBRARY" format="HTML" scope="SUITE" generated="2024-08-09T12:54:30+00:00" specversion="6" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapidriver.py" lineno="352">
3-
<version>0.3.0</version>
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>
44
<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>
55
<tags>
66
</tags>
@@ -265,7 +265,7 @@
265265
</init>
266266
</inits>
267267
<keywords>
268-
<kw name="Test Endpoint" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="156">
268+
<kw name="Test Endpoint" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="161">
269269
<arguments repr="path: str, method: str, status_code: int">
270270
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
271271
<name>path</name>
@@ -318,7 +318,7 @@
318318
</arg>
319319
</arguments>
320320
<doc>&lt;p&gt;Perform a request for the provided 'path' and 'method' where the url for the &lt;a href="#type-Path" class="name"&gt;path&lt;/a&gt; is invalidated.&lt;/p&gt;
321-
&lt;p&gt;This keyword will be &lt;span class="name"&gt;SKIPPED&lt;/span&gt; if the path contains no parts that can be invalidated.&lt;/p&gt;
321+
&lt;p&gt;This keyword will be &lt;span class="name"&gt;SKIPPED&lt;/span&gt; if the path contains no parts that can be invalidated and there is no mapping for a PathPropertiesConstraint for the &lt;span class="name"&gt;expected_status_code&lt;/span&gt;.&lt;/p&gt;
322322
&lt;p&gt;The optional &lt;span class="name"&gt;expected_status_code&lt;/span&gt; parameter (default: 404) can be set to the expected status code for APIs that do not return a 404 on invalid urls.&lt;/p&gt;
323323
&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>
324324
<shortdoc>Perform a request for the provided 'path' and 'method' where the url for the `path` is invalidated.</shortdoc>

src/OpenApiLibCore/openapi_libcore.libspec

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?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>
44
<doc>&lt;p&gt;Main class providing the keywords and core logic to interact with an OpenAPI server.&lt;/p&gt;
55
&lt;p&gt;Visit the &lt;a href="https://github.com/MarketSquare/robotframework-openapi-libcore"&gt;library page&lt;/a&gt; for an introduction.&lt;/p&gt;</doc>
66
<tags>
77
</tags>
88
<inits>
9-
<init name="__init__" lineno="439">
9+
<init name="__init__" lineno="465">
1010
<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">
1111
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="source: str">
1212
<name>source</name>
@@ -214,7 +214,7 @@
214214
</init>
215215
</inits>
216216
<keywords>
217-
<kw name="Authorized Request" lineno="1683">
217+
<kw name="Authorized Request" lineno="1731">
218218
<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">
219219
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
220220
<name>url</name>
@@ -307,7 +307,7 @@
307307
&lt;p&gt;&amp;gt; Note: provided username / password or auth objects take precedence over token based security&lt;/p&gt;</doc>
308308
<shortdoc>Perform a request using the security token or authentication set in the library.</shortdoc>
309309
</kw>
310-
<kw name="Ensure In Use" lineno="1587">
310+
<kw name="Ensure In Use" lineno="1635">
311311
<arguments repr="url: str, resource_relation: IdReference">
312312
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
313313
<name>url</name>
@@ -321,7 +321,7 @@
321321
<doc>&lt;p&gt;Ensure that the (right-most) &lt;span class="name"&gt;id&lt;/span&gt; of the resource referenced by the &lt;span class="name"&gt;url&lt;/span&gt; is used by the resource defined by the &lt;span class="name"&gt;resource_relation&lt;/span&gt;.&lt;/p&gt;</doc>
322322
<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>
323323
</kw>
324-
<kw name="Get Ids From Url" lineno="958">
324+
<kw name="Get Ids From Url" lineno="984">
325325
<arguments repr="url: str">
326326
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
327327
<name>url</name>
@@ -334,7 +334,7 @@
334334
<doc>&lt;p&gt;Perform a GET request on the &lt;span class="name"&gt;url&lt;/span&gt; and return the list of resource &lt;span class="name"&gt;ids&lt;/span&gt; from the response.&lt;/p&gt;</doc>
335335
<shortdoc>Perform a GET request on the `url` and return the list of resource `ids` from the response.</shortdoc>
336336
</kw>
337-
<kw name="Get Invalid Json Data" lineno="1364">
337+
<kw name="Get Invalid Json Data" lineno="1409">
338338
<arguments repr="url: str, method: str, status_code: int, request_data: RequestData">
339339
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
340340
<name>url</name>
@@ -361,7 +361,7 @@
361361
&lt;p&gt;&amp;gt; Note: applicable UniquePropertyValueConstraint and IdReference Relations are considered before changes to &lt;span class="name"&gt;json_data&lt;/span&gt; are made.&lt;/p&gt;</doc>
362362
<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>
363363
</kw>
364-
<kw name="Get Invalidated Parameters" lineno="1412">
364+
<kw name="Get Invalidated Parameters" lineno="1460">
365365
<arguments repr="status_code: int, request_data: RequestData">
366366
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="status_code: int">
367367
<name>status_code</name>
@@ -385,22 +385,37 @@
385385
<doc>&lt;p&gt;Returns a version of &lt;span class="name"&gt;params, headers&lt;/span&gt; as present on &lt;span class="name"&gt;request_data&lt;/span&gt; that has been modified to cause the provided &lt;span class="name"&gt;status_code&lt;/span&gt;.&lt;/p&gt;</doc>
386386
<shortdoc>Returns a version of `params, headers` as present on `request_data` that has been modified to cause the provided `status_code`.</shortdoc>
387387
</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">
390390
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="valid_url: str">
391391
<name>valid_url</name>
392392
<type name="str" typedoc="string"/>
393393
</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>
394409
</arguments>
395410
<returntype name="Union" union="true">
396411
<type name="str" typedoc="string"/>
397412
<type name="None" typedoc="None"/>
398413
</returntype>
399-
<doc>&lt;p&gt;Return an url with all the path parameters in the &lt;span class="name"&gt;valid_url&lt;/span&gt; replaced by a random UUID.&lt;/p&gt;
414+
<doc>&lt;p&gt;Return an url with all the path parameters in the &lt;span class="name"&gt;valid_url&lt;/span&gt; replaced by a random UUID if no PathPropertiesConstraint is mapped for the &lt;a href="#type-Path" class="name"&gt;path&lt;/a&gt;, &lt;span class="name"&gt;method&lt;/span&gt; and &lt;span class="name"&gt;expected_status_code&lt;/span&gt;. If a PathPropertiesConstraint is mapped, the &lt;span class="name"&gt;invalid_value&lt;/span&gt; is returned.&lt;/p&gt;
400415
&lt;p&gt;Raises ValueError if the valid_url cannot be invalidated.&lt;/p&gt;</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>
402417
</kw>
403-
<kw name="Get Json Data For Dto Class" lineno="1206">
418+
<kw name="Get Json Data For Dto Class" lineno="1232">
404419
<arguments repr="schema: Dict[str, Any], dto_class: Dto | Type[Dto], operation_id: str = ">
405420
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="schema: Dict[str, Any]">
406421
<name>schema</name>
@@ -434,7 +449,7 @@
434449
<doc>&lt;p&gt;Generate a valid (json-compatible) dict for all the &lt;span class="name"&gt;dto_class&lt;/span&gt; properties.&lt;/p&gt;</doc>
435450
<shortdoc>Generate a valid (json-compatible) dict for all the `dto_class` properties.</shortdoc>
436451
</kw>
437-
<kw name="Get Json Data With Conflict" lineno="1631">
452+
<kw name="Get Json Data With Conflict" lineno="1679">
438453
<arguments repr="url: str, method: str, dto: Dto, conflict_status_code: int">
439454
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
440455
<name>url</name>
@@ -460,7 +475,7 @@
460475
<doc>&lt;p&gt;Return &lt;span class="name"&gt;json_data&lt;/span&gt; based on the &lt;span class="name"&gt;UniquePropertyValueConstraint&lt;/span&gt; that must be returned by the &lt;span class="name"&gt;get_relations&lt;/span&gt; implementation on the &lt;span class="name"&gt;dto&lt;/span&gt; for the given &lt;span class="name"&gt;conflict_status_code&lt;/span&gt;.&lt;/p&gt;</doc>
461476
<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>
462477
</kw>
463-
<kw name="Get Parameterized Endpoint From Url" lineno="1352">
478+
<kw name="Get Parameterized Endpoint From Url" lineno="1397">
464479
<arguments repr="url: str">
465480
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
466481
<name>url</name>
@@ -471,7 +486,7 @@
471486
<doc>&lt;p&gt;Return the endpoint as found in the &lt;span class="name"&gt;paths&lt;/span&gt; section based on the given &lt;span class="name"&gt;url&lt;/span&gt;.&lt;/p&gt;</doc>
472487
<shortdoc>Return the endpoint as found in the `paths` section based on the given `url`.</shortdoc>
473488
</kw>
474-
<kw name="Get Request Data" lineno="998">
489+
<kw name="Get Request Data" lineno="1024">
475490
<arguments repr="endpoint: str, method: str">
476491
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="endpoint: str">
477492
<name>endpoint</name>
@@ -486,7 +501,7 @@
486501
<doc>&lt;p&gt;Return an object with valid request data for body, headers and query params.&lt;/p&gt;</doc>
487502
<shortdoc>Return an object with valid request data for body, headers and query params.</shortdoc>
488503
</kw>
489-
<kw name="Get Valid Id For Endpoint" lineno="862">
504+
<kw name="Get Valid Id For Endpoint" lineno="888">
490505
<arguments repr="endpoint: str, method: str">
491506
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="endpoint: str">
492507
<name>endpoint</name>
@@ -506,7 +521,7 @@
506521
&lt;p&gt;To prevent resource conflicts with other test cases, a new resource is created (POST) if possible.&lt;/p&gt;</doc>
507522
<shortdoc>Support keyword that returns the `id` for an existing resource at `endpoint`.</shortdoc>
508523
</kw>
509-
<kw name="Get Valid Url" lineno="822">
524+
<kw name="Get Valid Url" lineno="848">
510525
<arguments repr="endpoint: str, method: str">
511526
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="endpoint: str">
512527
<name>endpoint</name>
@@ -523,7 +538,7 @@
523538
&lt;p&gt;&amp;gt; Note: if valid ids cannot be retrieved within the scope of the API, the &lt;span class="name"&gt;PathPropertiesConstraint&lt;/span&gt; Relation can be used. More information can be found &lt;a href="https://marketsquare.github.io/robotframework-openapi-libcore/advanced_use.html"&gt;here&lt;/a&gt;.&lt;/p&gt;</doc>
524539
<shortdoc>This keyword returns a valid url for the given `endpoint` and `method`.</shortdoc>
525540
</kw>
526-
<kw name="Perform Validated Request" lineno="1730">
541+
<kw name="Perform Validated Request" lineno="1778">
527542
<arguments repr="path: str, status_code: int, request_values: RequestValues, original_data: Dict[str, Any] | None = None">
528543
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
529544
<name>path</name>
@@ -552,7 +567,7 @@
552567
<doc>&lt;p&gt;This keyword first calls the Authorized Request keyword, then the Validate Response keyword and finally validates, for &lt;span class="name"&gt;DELETE&lt;/span&gt; operations, whether the target resource was indeed deleted (OK response) or not (error responses).&lt;/p&gt;</doc>
553568
<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>
554569
</kw>
555-
<kw name="Set Auth" lineno="677">
570+
<kw name="Set Auth" lineno="703">
556571
<arguments repr="auth: AuthBase">
557572
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="auth: AuthBase">
558573
<name>auth</name>
@@ -563,7 +578,7 @@
563578
&lt;p&gt;After calling this keyword, subsequent requests will use the provided &lt;span class="name"&gt;auth&lt;/span&gt; instance.&lt;/p&gt;</doc>
564579
<shortdoc>Set the `auth` used for authentication after the library is imported.</shortdoc>
565580
</kw>
566-
<kw name="Set Basic Auth" lineno="665">
581+
<kw name="Set Basic Auth" lineno="691">
567582
<arguments repr="username: str, password: str">
568583
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="username: str">
569584
<name>username</name>
@@ -578,7 +593,7 @@
578593
&lt;p&gt;After calling this keyword, subsequent requests will use the provided credentials.&lt;/p&gt;</doc>
579594
<shortdoc>Set the `username` and `password` used for basic authentication after the library is imported.</shortdoc>
580595
</kw>
581-
<kw name="Set Extra Headers" lineno="687">
596+
<kw name="Set Extra Headers" lineno="713">
582597
<arguments repr="extra_headers: Dict[str, str]">
583598
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="extra_headers: Dict[str, str]">
584599
<name>extra_headers</name>
@@ -592,7 +607,7 @@
592607
&lt;p&gt;After calling this keyword, subsequent requests will use the provided &lt;span class="name"&gt;extra_headers&lt;/span&gt;.&lt;/p&gt;</doc>
593608
<shortdoc>Set the `extra_headers` used in requests after the library is imported.</shortdoc>
594609
</kw>
595-
<kw name="Set Origin" lineno="642">
610+
<kw name="Set Origin" lineno="668">
596611
<arguments repr="origin: str">
597612
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="origin: str">
598613
<name>origin</name>
@@ -604,7 +619,7 @@
604619
&lt;p&gt;In combination with OpenApiLibCore, the &lt;span class="name"&gt;origin&lt;/span&gt; can be used at any point to target another server that hosts an API that complies to the same OAS.&lt;/p&gt;</doc>
605620
<shortdoc>Set the `origin` after the library is imported.</shortdoc>
606621
</kw>
607-
<kw name="Set Security Token" lineno="656">
622+
<kw name="Set Security Token" lineno="682">
608623
<arguments repr="security_token: str">
609624
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="security_token: str">
610625
<name>security_token</name>
@@ -615,7 +630,7 @@
615630
&lt;p&gt;After calling this keyword, subsequent requests will use the provided token.&lt;/p&gt;</doc>
616631
<shortdoc>Set the `security_token` after the library is imported.</shortdoc>
617632
</kw>
618-
<kw name="Validate Resource Properties" lineno="1966">
633+
<kw name="Validate Resource Properties" lineno="2019">
619634
<arguments repr="resource: Dict[str, Any], schema: Dict[str, Any]">
620635
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="resource: Dict[str, Any]">
621636
<name>resource</name>
@@ -635,7 +650,7 @@
635650
<doc>&lt;p&gt;Validate that the &lt;span class="name"&gt;resource&lt;/span&gt; does not contain any properties that are not defined in the &lt;span class="name"&gt;schema_properties&lt;/span&gt;.&lt;/p&gt;</doc>
636651
<shortdoc>Validate that the `resource` does not contain any properties that are not defined in the `schema_properties`.</shortdoc>
637652
</kw>
638-
<kw name="Validate Response" lineno="1804">
653+
<kw name="Validate Response" lineno="1852">
639654
<arguments repr="path: str, response: Response, original_data: Dict[str, Any] | None = None">
640655
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
641656
<name>path</name>
@@ -668,7 +683,7 @@
668683
&lt;/ul&gt;</doc>
669684
<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>
670685
</kw>
671-
<kw name="Validate Send Response" lineno="2084">
686+
<kw name="Validate Send Response" lineno="2137">
672687
<arguments repr="response: Response, original_data: Dict[str, Any] | None = None">
673688
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="response: Response">
674689
<name>response</name>
@@ -772,6 +787,7 @@
772787
<usage>Authorized Request</usage>
773788
<usage>Get Invalid Json Data</usage>
774789
<usage>Get Invalidated Parameters</usage>
790+
<usage>Get Invalidated Url</usage>
775791
<usage>Get Json Data With Conflict</usage>
776792
<usage>Get Valid Id For Endpoint</usage>
777793
<usage>Perform Validated Request</usage>

0 commit comments

Comments
 (0)