:version:`3.20.0 <v3.19.7...v3.20.0>` - 2023-10-18
--------------------------------------------------
**Added**
- Support for ``application/xml`` serialization based on Open API schema definitions. :issue:`733`
- Hook shortcuts (``filter_query``, ``map_header``, etc.) to minimize boilerplate in extensions. :issue:`1673`
- Support for colored output from docker container. :issue:`1170`
- A way to disable suggestion for visualizing test results via the ``SCHEMATHESIS_REPORT_SUGGESTION=0`` environment variable. :issue:`1802`
- Automatic FastAPI fixup injecting for ASGI loaders, eliminating the need for manual setup. :issue:`1797`
- Support for ``body`` hooks in GraphQL schemas, enabling custom filtering or modification of queries and mutations. :issue:`1464`
- New ``filter_operations`` hook to conditionally include or exclude specific API operations from being tested.
- Added ``contains`` method to ``ParameterSet`` for easier parameter checks in hooks. :issue:`1789`
- Automatic sanitization of sensitive data in the output is now enabled by default. This feature can be disabled using the ``--sanitize-output=false`` CLI option. For more advanced customization, use ``schemathesis.sanitizing.configure()``. :issue:`1794`
- ``--experimental=openapi-3.1`` CLI option for experimental support of OpenAPI 3.1. This enables compatible JSON Schema validation for responses, while data generation remains OpenAPI 3.0-compatible. :issue:`1820`
**Note**: Experimental features can change or be removed in any minor version release.
**Changed**
- Support ``Werkzeug>=3.0``. :issue:`1819`
- Refined generated reproduction code and shortened ``X-Schemathesis-TestCaseId`` for easier debugging. :issue:`1801`
- Add ``case`` as the first argument to ``AuthContext.set``. Previous calling convention is still supported. :issue:`1788`
- Disable the 'explain' phase in Hypothesis to improve performance. :issue:`1808`
- Simplify Python code samples for failure reproduction.
- Do not display ``InsecureRequestWarning`` in CLI output if the user explicitly provided ``--request-tls-verify=false``. :issue:`1780`
- Enhance CLI output for schema loading and internal errors, providing clearer diagnostics and guidance. :issue:`1781`, :issue:`1517`, :issue:`1472`
Before:
.. code:: text
Failed to load schema from https://127.0.0.1:6423/openapi.json
You can use `--wait-for-schema=NUM` to wait for a maximum of NUM seconds on the API schema availability.
Error: requests.exceptions.SSLError: HTTPSConnectionPool(host='localhost', port=6423): Max retries exceeded with url: /openapi.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:992)')))
Add this option to your command line parameters to see full tracebacks: --show-errors-tracebacks
After:
.. code:: text
Schema Loading Error
SSL verification problem
[SSL: WRONG_VERSION_NUMBER] wrong version number
Tip: Bypass SSL verification with `--request-tls-verify=false`.
**Deprecated**
- Defining ``AuthProvider.get`` with a single ``context`` argument. The support will be removed in Schemathesis ``4.0``.
**Fixed**
- Fixed type hint for ``AuthProvider``. :issue:`1776`
- Do not skip negative tests if the generated value is ``None``.
- Lack of execution for ASGI events during testing. :issue:`1305`, :issue:`1727`
- Confusing error message when trying to load schema from a non-existing file. :issue:`1602`
- Reflect disabled TLS verification in generated code samples. :issue:`1054`
- Generated cURL commands now include the ``Content-Type`` header, which was previously omitted. :issue:`1783`
- Improperly serialized headers in ``SerializedHistoryEntry.case.extra_headers``.
**Performance**
- Optimize event data emission by postponing code sample generation, resulting in a ``~4%`` reduction in the emitted events data size.
**Removed**
- Unused ``SerializedError.example`` attribute. It used to be populated for flaky errors before they became regular failures.
- Unused ``TestResult.overridden_headers`` attribute.