Skip to content

Commit

Permalink
Version bump to 0.4.0, updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
robinmackaij committed Dec 4, 2024
1 parent af38547 commit c3545fd
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 36 deletions.
4 changes: 2 additions & 2 deletions docs/openapi_libcore.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/openapidriver.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name="robotframework-openapitools"
version = "0.3.0"
version = "0.4.0"
description = "A set of Robot Framework libraries to test APIs for which the OAS is available."
license = "Apache-2.0"
authors = [
Expand Down
8 changes: 4 additions & 4 deletions src/OpenApiDriver/openapidriver.libspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<version>0.3.0</version>
<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">
<version>0.4.0</version>
<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>
<tags>
</tags>
Expand Down Expand Up @@ -265,7 +265,7 @@
</init>
</inits>
<keywords>
<kw name="Test Endpoint" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="156">
<kw name="Test Endpoint" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="161">
<arguments repr="path: str, method: str, status_code: int">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
<name>path</name>
Expand Down Expand Up @@ -318,7 +318,7 @@
</arg>
</arguments>
<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;
&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;
&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;
&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;
&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>
<shortdoc>Perform a request for the provided 'path' and 'method' where the url for the `path` is invalidated.</shortdoc>
Expand Down
70 changes: 43 additions & 27 deletions src/OpenApiLibCore/openapi_libcore.libspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<version>0.3.0</version>
<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">
<version>0.4.0</version>
<doc>&lt;p&gt;Main class providing the keywords and core logic to interact with an OpenAPI server.&lt;/p&gt;
&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>
<tags>
</tags>
<inits>
<init name="__init__" lineno="439">
<init name="__init__" lineno="465">
<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">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="source: str">
<name>source</name>
Expand Down Expand Up @@ -214,7 +214,7 @@
</init>
</inits>
<keywords>
<kw name="Authorized Request" lineno="1683">
<kw name="Authorized Request" lineno="1731">
<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">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
<name>url</name>
Expand Down Expand Up @@ -307,7 +307,7 @@
&lt;p&gt;&amp;gt; Note: provided username / password or auth objects take precedence over token based security&lt;/p&gt;</doc>
<shortdoc>Perform a request using the security token or authentication set in the library.</shortdoc>
</kw>
<kw name="Ensure In Use" lineno="1587">
<kw name="Ensure In Use" lineno="1635">
<arguments repr="url: str, resource_relation: IdReference">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
<name>url</name>
Expand All @@ -321,7 +321,7 @@
<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>
<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>
</kw>
<kw name="Get Ids From Url" lineno="958">
<kw name="Get Ids From Url" lineno="984">
<arguments repr="url: str">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
<name>url</name>
Expand All @@ -334,7 +334,7 @@
<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>
<shortdoc>Perform a GET request on the `url` and return the list of resource `ids` from the response.</shortdoc>
</kw>
<kw name="Get Invalid Json Data" lineno="1364">
<kw name="Get Invalid Json Data" lineno="1409">
<arguments repr="url: str, method: str, status_code: int, request_data: RequestData">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
<name>url</name>
Expand All @@ -361,7 +361,7 @@
&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>
<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>
</kw>
<kw name="Get Invalidated Parameters" lineno="1412">
<kw name="Get Invalidated Parameters" lineno="1460">
<arguments repr="status_code: int, request_data: RequestData">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="status_code: int">
<name>status_code</name>
Expand All @@ -385,22 +385,37 @@
<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>
<shortdoc>Returns a version of `params, headers` as present on `request_data` that has been modified to cause the provided `status_code`.</shortdoc>
</kw>
<kw name="Get Invalidated Url" lineno="1330">
<arguments repr="valid_url: str">
<kw name="Get Invalidated Url" lineno="1356">
<arguments repr="valid_url: str, path: str = , method: str = , expected_status_code: int = 404">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="valid_url: str">
<name>valid_url</name>
<type name="str" typedoc="string"/>
</arg>
<arg kind="POSITIONAL_OR_NAMED" required="false" repr="path: str = ">
<name>path</name>
<type name="str" typedoc="string"/>
<default/>
</arg>
<arg kind="POSITIONAL_OR_NAMED" required="false" repr="method: str = ">
<name>method</name>
<type name="str" typedoc="string"/>
<default/>
</arg>
<arg kind="POSITIONAL_OR_NAMED" required="false" repr="expected_status_code: int = 404">
<name>expected_status_code</name>
<type name="int" typedoc="integer"/>
<default>404</default>
</arg>
</arguments>
<returntype name="Union" union="true">
<type name="str" typedoc="string"/>
<type name="None" typedoc="None"/>
</returntype>
<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;
<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;
&lt;p&gt;Raises ValueError if the valid_url cannot be invalidated.&lt;/p&gt;</doc>
<shortdoc>Return an url with all the path parameters in the `valid_url` replaced by a random UUID.</shortdoc>
<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>
</kw>
<kw name="Get Json Data For Dto Class" lineno="1206">
<kw name="Get Json Data For Dto Class" lineno="1232">
<arguments repr="schema: Dict[str, Any], dto_class: Dto | Type[Dto], operation_id: str = ">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="schema: Dict[str, Any]">
<name>schema</name>
Expand Down Expand Up @@ -434,7 +449,7 @@
<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>
<shortdoc>Generate a valid (json-compatible) dict for all the `dto_class` properties.</shortdoc>
</kw>
<kw name="Get Json Data With Conflict" lineno="1631">
<kw name="Get Json Data With Conflict" lineno="1679">
<arguments repr="url: str, method: str, dto: Dto, conflict_status_code: int">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
<name>url</name>
Expand All @@ -460,7 +475,7 @@
<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>
<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>
</kw>
<kw name="Get Parameterized Endpoint From Url" lineno="1352">
<kw name="Get Parameterized Endpoint From Url" lineno="1397">
<arguments repr="url: str">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="url: str">
<name>url</name>
Expand All @@ -471,7 +486,7 @@
<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>
<shortdoc>Return the endpoint as found in the `paths` section based on the given `url`.</shortdoc>
</kw>
<kw name="Get Request Data" lineno="998">
<kw name="Get Request Data" lineno="1024">
<arguments repr="endpoint: str, method: str">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="endpoint: str">
<name>endpoint</name>
Expand All @@ -486,7 +501,7 @@
<doc>&lt;p&gt;Return an object with valid request data for body, headers and query params.&lt;/p&gt;</doc>
<shortdoc>Return an object with valid request data for body, headers and query params.</shortdoc>
</kw>
<kw name="Get Valid Id For Endpoint" lineno="862">
<kw name="Get Valid Id For Endpoint" lineno="888">
<arguments repr="endpoint: str, method: str">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="endpoint: str">
<name>endpoint</name>
Expand All @@ -506,7 +521,7 @@
&lt;p&gt;To prevent resource conflicts with other test cases, a new resource is created (POST) if possible.&lt;/p&gt;</doc>
<shortdoc>Support keyword that returns the `id` for an existing resource at `endpoint`.</shortdoc>
</kw>
<kw name="Get Valid Url" lineno="822">
<kw name="Get Valid Url" lineno="848">
<arguments repr="endpoint: str, method: str">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="endpoint: str">
<name>endpoint</name>
Expand All @@ -523,7 +538,7 @@
&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>
<shortdoc>This keyword returns a valid url for the given `endpoint` and `method`.</shortdoc>
</kw>
<kw name="Perform Validated Request" lineno="1730">
<kw name="Perform Validated Request" lineno="1778">
<arguments repr="path: str, status_code: int, request_values: RequestValues, original_data: Dict[str, Any] | None = None">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
<name>path</name>
Expand Down Expand Up @@ -552,7 +567,7 @@
<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>
<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>
</kw>
<kw name="Set Auth" lineno="677">
<kw name="Set Auth" lineno="703">
<arguments repr="auth: AuthBase">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="auth: AuthBase">
<name>auth</name>
Expand All @@ -563,7 +578,7 @@
&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>
<shortdoc>Set the `auth` used for authentication after the library is imported.</shortdoc>
</kw>
<kw name="Set Basic Auth" lineno="665">
<kw name="Set Basic Auth" lineno="691">
<arguments repr="username: str, password: str">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="username: str">
<name>username</name>
Expand All @@ -578,7 +593,7 @@
&lt;p&gt;After calling this keyword, subsequent requests will use the provided credentials.&lt;/p&gt;</doc>
<shortdoc>Set the `username` and `password` used for basic authentication after the library is imported.</shortdoc>
</kw>
<kw name="Set Extra Headers" lineno="687">
<kw name="Set Extra Headers" lineno="713">
<arguments repr="extra_headers: Dict[str, str]">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="extra_headers: Dict[str, str]">
<name>extra_headers</name>
Expand All @@ -592,7 +607,7 @@
&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>
<shortdoc>Set the `extra_headers` used in requests after the library is imported.</shortdoc>
</kw>
<kw name="Set Origin" lineno="642">
<kw name="Set Origin" lineno="668">
<arguments repr="origin: str">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="origin: str">
<name>origin</name>
Expand All @@ -604,7 +619,7 @@
&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>
<shortdoc>Set the `origin` after the library is imported.</shortdoc>
</kw>
<kw name="Set Security Token" lineno="656">
<kw name="Set Security Token" lineno="682">
<arguments repr="security_token: str">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="security_token: str">
<name>security_token</name>
Expand All @@ -615,7 +630,7 @@
&lt;p&gt;After calling this keyword, subsequent requests will use the provided token.&lt;/p&gt;</doc>
<shortdoc>Set the `security_token` after the library is imported.</shortdoc>
</kw>
<kw name="Validate Resource Properties" lineno="1966">
<kw name="Validate Resource Properties" lineno="2019">
<arguments repr="resource: Dict[str, Any], schema: Dict[str, Any]">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="resource: Dict[str, Any]">
<name>resource</name>
Expand All @@ -635,7 +650,7 @@
<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>
<shortdoc>Validate that the `resource` does not contain any properties that are not defined in the `schema_properties`.</shortdoc>
</kw>
<kw name="Validate Response" lineno="1804">
<kw name="Validate Response" lineno="1852">
<arguments repr="path: str, response: Response, original_data: Dict[str, Any] | None = None">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
<name>path</name>
Expand Down Expand Up @@ -668,7 +683,7 @@
&lt;/ul&gt;</doc>
<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>
</kw>
<kw name="Validate Send Response" lineno="2084">
<kw name="Validate Send Response" lineno="2137">
<arguments repr="response: Response, original_data: Dict[str, Any] | None = None">
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="response: Response">
<name>response</name>
Expand Down Expand Up @@ -772,6 +787,7 @@
<usage>Authorized Request</usage>
<usage>Get Invalid Json Data</usage>
<usage>Get Invalidated Parameters</usage>
<usage>Get Invalidated Url</usage>
<usage>Get Json Data With Conflict</usage>
<usage>Get Valid Id For Endpoint</usage>
<usage>Perform Validated Request</usage>
Expand Down

0 comments on commit c3545fd

Please sign in to comment.