diff --git a/docs/openapi_libcore.html b/docs/openapi_libcore.html index 7dbc7dc..73256e5 100644 --- a/docs/openapi_libcore.html +++ b/docs/openapi_libcore.html @@ -1190,7 +1190,7 @@ jQuery.extend({highlight:function(e,t,n,r){if(e.nodeType===3){var i=e.data.match(t);if(i){var s=document.createElement(n||"span");s.className=r||"highlight";var o=e.splitText(i.index);o.splitText(i[0].length);var u=o.cloneNode(true);s.appendChild(u);o.parentNode.replaceChild(s,o);return 1}}else if(e.nodeType===1&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&!(e.tagName===n.toUpperCase()&&e.className===r)){for(var a=0;a diff --git a/pyproject.toml b/pyproject.toml index 04f2f2b..440c0f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name="robotframework-openapi-libcore" -version = "1.9.0" +version = "1.9.1" description = "A Robot Framework library to facilitate library development for OpenAPI / Swagger APIs." license = "Apache-2.0" authors = ["Robin Mackaij "] diff --git a/src/OpenApiLibCore/openapi_libcore.libspec b/src/OpenApiLibCore/openapi_libcore.libspec index 1cca80f..064771f 100644 --- a/src/OpenApiLibCore/openapi_libcore.libspec +++ b/src/OpenApiLibCore/openapi_libcore.libspec @@ -1,6 +1,6 @@ - -1.9.0 + +1.9.1 <p>Main class providing the keywords and core logic to interact with an OpenAPI server.</p> <p>Visit the <a href="https://github.com/MarketSquare/robotframework-openapi-libcore">library page</a> for an introduction.</p> @@ -156,7 +156,7 @@ - + url @@ -194,7 +194,7 @@ <p>&gt; Note: provided username / password or auth objects take precedence over token based security</p> Perform a request using the security token or authentication set in the library. - + url @@ -208,7 +208,7 @@ <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> Ensure that the (right-most) `id` of the resource referenced by the `url` is used by the resource defined by the `resource_relation`. - + url @@ -218,7 +218,7 @@ <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> Perform a GET request on the `url` and return the list of resource `ids` from the response. - + url @@ -241,7 +241,7 @@ <p>&gt; Note: applicable UniquePropertyValueConstraint and IdReference Relations are considered before changes to <span class="name">json_data</span> are made.</p> 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`. - + status_code @@ -255,7 +255,7 @@ <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> Returns a version of `params, headers` as present on `request_data` that has been modified to cause the provided `status_code`. - + valid_url @@ -266,7 +266,7 @@ <p>Raises ValueError if the valid_url cannot be invalidated.</p> Return an url with all the path parameters in the `valid_url` replaced by a random UUID. - + schema @@ -286,7 +286,7 @@ <p>Generate a valid (json-compatible) dict for all the <span class="name">dto_class</span> properties.</p> Generate a valid (json-compatible) dict for all the `dto_class` properties. - + url @@ -308,7 +308,7 @@ <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> 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`. - + url @@ -318,7 +318,7 @@ <p>Return the endpoint as found in the <span class="name">paths</span> section based on the given <span class="name">url</span>.</p> Return the endpoint as found in the `paths` section based on the given `url`. - + endpoint diff --git a/src/OpenApiLibCore/openapi_libcore.py b/src/OpenApiLibCore/openapi_libcore.py index c95e619..4b0449b 100644 --- a/src/OpenApiLibCore/openapi_libcore.py +++ b/src/OpenApiLibCore/openapi_libcore.py @@ -634,16 +634,18 @@ def get_valid_url(self, endpoint: str, method: str) -> str: if part.startswith("{") and part.endswith("}"): type_endpoint_parts = endpoint_parts[slice(index)] type_endpoint = "/".join(type_endpoint_parts) - existing_id: str = run_keyword( + existing_id: Union[str, int, float] = run_keyword( "get_valid_id_for_endpoint", type_endpoint, method ) - endpoint_parts[index] = existing_id + endpoint_parts[index] = str(existing_id) resolved_endpoint = "/".join(endpoint_parts) url = f"{self.base_url}{resolved_endpoint}" return url @keyword - def get_valid_id_for_endpoint(self, endpoint: str, method: str) -> str: + def get_valid_id_for_endpoint( + self, endpoint: str, method: str + ) -> Union[str, int, float]: """ Support keyword that returns the `id` for an existing resource at `endpoint`. diff --git a/tasks.py b/tasks.py index 82ef772..d7a4041 100644 --- a/tasks.py +++ b/tasks.py @@ -65,8 +65,8 @@ def tests(context): @task def lint(context): - subprocess.run(f"mypy {ROOT}", shell=True, check=False) - subprocess.run(f"pylint {ROOT}/src/OpenApiLibCore", shell=True, check=False) + subprocess.run(f"mypy {ROOT}/src", shell=True, check=False) + subprocess.run(f"pylint {ROOT}/src", shell=True, check=False) subprocess.run(f"robocop {ROOT}/tests/suites", shell=True, check=False)