Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/coverage-badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/openapi_libcore.html

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions docs/openapidriver.html

Large diffs are not rendered by default.

26 changes: 17 additions & 9 deletions docs/releases.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# Release notes

## OpenApiTools v2.0.0
## OpenApiTools v2.0.1

### Major changes and new features
### Bugfixes
- Moved header sanitazion to ensure it's always applied.
- This closes [issue #137: Error on DataValidationError](https://github.com/MarketSquare/robotframework-openapitools/issues/137).

<br><br><br>

## Previous versions

### OpenApiTools v2.0.0

#### Major changes and new features
- Request bodies now support all JSON types, not just `objects` (`dicts`).
- This closes [issue #9: No body generated when root is a list](https://github.com/MarketSquare/robotframework-openapitools/issues/9).
- Some of the `Relations` still need to be reworked to (fully) align with this change.
Expand Down Expand Up @@ -32,7 +42,7 @@
- The `Test Endpoint` keyword of OpenApiDriver now also support error codes from a `PathPropertiesConstraint`.
- This closes [issue #126: Path invalidation based on error code not supported by OpenApiDriver](https://github.com/MarketSquare/robotframework-openapitools/issues/126).

### Bugfixes
#### Bugfixes
- Added support for the `nullable` property in OAS 3.0 schemas when generating data.
- This closes [issue #81: nullable not taken into account in get_valid_value](https://github.com/MarketSquare/robotframework-openapitools/issues/81).
- Support added for multiple instances of OpenApiLibCore within the same suite.
Expand All @@ -46,7 +56,7 @@
- Fixed validation errors caused by `Content-Type` not being handled case-insensitive.
- Fixed an exception during validation caused by `charset` being included in the `Content-Type` header for `application/json`.

### Breaking changes
#### Breaking changes
- Addressing [issue #95: Refactor: better name for Dto](https://github.com/MarketSquare/robotframework-openapitools/issues/95) introduces a number breaking renames:
- `Dto` has been renamed to `RelationsMapping`.
- `constraint_mapping` has been renamed to `relations_mapping` in a number of places.
Expand All @@ -57,21 +67,19 @@
- The `relations_mapping` property was added.
- `invalid_property_default_response` library parameter renamed to `invalid_data_default_response`.

### Additional changes
#### Additional changes
- Special handling of `"format": "byte"` for `"type": "string"` (OAS 3.0) was removed.
- While some logic related to this worked, the result was never JSON-serializable.
- The devcontainer setup was updated.
- The GitHub pipeline was updated to include Python 3.14.
- Updated minimum version markers for many dependencies.
- Annotations are now complete (as far as possible under Python 3.10).

### Notes
#### Notes
- The documentation is not yet updated with many of the changes / improvements detailed above.
- While some tests have been updated to check / demonstrate the above changes, more tests need to be added.

<br><br><br>

## Previous versions
---

### OpenApiTools v1.0.5

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name="robotframework-openapitools"
version = "2.0.0"
version = "2.0.1"
description = "A set of Robot Framework libraries to test APIs for which the OAS is available."
authors = [
{name = "Robin Mackaij", email = "r.a.mackaij@gmail.com"},
Expand Down
4 changes: 2 additions & 2 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="2026-02-03T14:03:08+00:00" specversion="6" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapidriver.py" lineno="24">
<version>2.0.0</version>
<keywordspec name="OpenApiDriver" type="LIBRARY" format="HTML" scope="SUITE" generated="2026-04-08T09:47:51+00:00" specversion="6" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapidriver.py" lineno="24">
<version>2.0.1</version>
<doc>The OpenApiDriver library provides the keywords and logic for execution of generated test cases based on an OpenAPI document.

Visit the &lt;a href="./index.html" target="_blank"&gt;OpenApiTools documentation&lt;/a&gt; for an introduction.</doc>
Expand Down
23 changes: 13 additions & 10 deletions src/OpenApiLibCore/keyword_logic/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,19 @@ def validate_response_using_validator(
) -> None:
openapi_request = RequestsOpenAPIRequest(response.request)
openapi_response = RequestsOpenAPIResponse(response)

# sanitize the response header; a charset in the content-type causes a deserialization error
content_type = response.headers.get("Content-Type", "")
if content_type:
key_value = "Content-Type"
else:
content_type = response.headers.get("content-type", "")
if content_type:
key_value = "content-type"
if "json" in content_type.lower():
content_type, _, _ = content_type.partition(";")
response.headers.update({key_value: content_type}) # pyright: ignore[reportPossiblyUnboundVariable]

response_validator(request=openapi_request, response=openapi_response)


Expand All @@ -365,16 +378,6 @@ def _validate_response(
response_validation: str,
) -> None:
try:
content_type = response.headers.get("Content-Type", "")
if content_type:
key_value = "Content-Type"
else:
content_type = response.headers.get("content-type", "")
if content_type:
key_value = "content-type"
if "json" in content_type.lower():
content_type, _, _ = content_type.partition(";")
response.headers.update({key_value: content_type}) # pyright: ignore[reportPossiblyUnboundVariable]
validate_response_using_validator(
response=response,
response_validator=response_validator,
Expand Down
4 changes: 2 additions & 2 deletions src/OpenApiLibCore/openapi_libcore.libspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<keywordspec name="OpenApiLibCore" type="LIBRARY" format="HTML" scope="SUITE" generated="2026-02-03T14:02:56+00:00" specversion="6" source="/workspaces/robotframework-openapitools/src/OpenApiLibCore/openapi_libcore.py" lineno="95">
<version>2.0.0</version>
<keywordspec name="OpenApiLibCore" type="LIBRARY" format="HTML" scope="SUITE" generated="2026-04-08T09:47:50+00:00" specversion="6" source="/workspaces/robotframework-openapitools/src/OpenApiLibCore/openapi_libcore.py" lineno="95">
<version>2.0.1</version>
<doc>The OpenApiLibCore library provides the keywords and core logic to interact with an OpenAPI server.

Visit the &lt;a href="./index.html" target="_blank"&gt;OpenApiTools documentation&lt;/a&gt; for an introduction.</doc>
Expand Down
Loading