Download Latest Version v2.4.0 source code.tar.gz (2.0 MB)
Email in envelope

Get an email when there's a new version of BlackSheep

Home / v2.2.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-04-28 4.0 kB
v2.2.0 source code.tar.gz 2025-04-28 2.0 MB
v2.2.0 source code.zip 2025-04-28 2.0 MB
Totals: 3 Items   4.0 MB 0
  • Fix [#533]. A feature that was requested several times in the past! Add support for delegating the generation of OpenAPI schemas for types to external libraries and completely relies on schemas generated by Pydantic when working with pydantic.BaseModel.
  • Add support for handling Pydantic dataclasses when generating OpenAPI documentation.
  • Add the possibility to control the Serializer class used to generate the dict object of the OpenAPI Specification and to serialize it to JSON and YAML. This grants the user full control over the OpenAPI Specification, and enables more scenarios as users can modify the specification object comfortably and as they need. To use, pass a serializer parameter to the OpenAPIHandler's constructor.
  • Generates OpenAPI Specification with version 3.1.0 instead of 3.0.3.
  • Update essentials-openapi dependency to version >=1.2.0.
  • Fix [#541]. Correct the type hint for the Jinja loader to use the abstract interface BaseLoader.
  • Fix [#517]. Add support for any HTTP method when writing HTTP requests, not only for the most common methods.
  • Fix [#529]. Add missing Jinja2 dependency in the full package.
  • Fix type annotation in messages.pyi, by @bymoye.
  • Add support for mapping types in OpenAPI Documentation, by @tyzhnenko.
  • Improve blacksheep/server/normalization.py to bind any subclass of Identity using the request.user rather than just User and Identity exactly, by @bymoye.
  • Add new UI provider for OpenAPI Documentation, for Scalar UI, by @arthurbrenno and @bymoye.
  • Correct the ReDocUIProvider to support a custom favicon.
  • Fix [#538]. The Application object can now use both Type keys and int keys when applying the default Not Found exception handler and the Internal Server Error exception handler.
  • BREAKING CHANGE. When an unhandled exception occurs, user-defined exception handlers for Internal Server Error status now always receive an instance of InternalServerError class, containing a reference to the source exception. Previously, user-defined internal server error handlers would erroneously receive any type of unhandled exception. If you defined your own exception handler for InternalServerError or for 500 status and you applied logic based on the type of the unhandled exception, update the code to read the source unhandled exception from exc.source_error.
  • BREAKING CHANGE. Fix bug that would prevent show_error_details from working as intended when a user-defined InternalServerError exception handlers was defined. When show_error_details is enabled, any unhandled exception is handled by the code that procudes the HTML document with error details and the stack trace of the error, even if the user configured an exception handler for internal server errors (using 500 or InternalServerError as keys). This is a breaking change if you made the mistake of running a production application with show_error_details enabled, and exception details are hidden using a custom 500 exception handler.
  • Improve type annotations for get_files_to_serve and get_files_list_html_response.
  • The TextBinder is made a subclass of BodyBinder. This is correct and enables validation of handler signature and better generation of OpenAPI documentation. This binder was always about reading the request body as plain text.
  • Modify pyproject.toml to specify requires-python = ">=3.8" instead of requires-python = ">=3.7".
  • Update the error message of the AmbiguousMethodSignatureError to make it clearer and offer a better user experience.
  • Update the default message of the InternalServerError class to be Internal Server Error instead of Internal server error..
Source: README.md, updated 2025-04-28