From 207477730d56991fabc4f54169700e2ed028df6b Mon Sep 17 00:00:00 2001 From: gdoumenc Date: Fri, 15 Nov 2024 14:36:52 +0100 Subject: [PATCH] version 1.18 --- coworks/extension/jsonapi/jsonapi.py | 4 +--- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/coworks/extension/jsonapi/jsonapi.py b/coworks/extension/jsonapi/jsonapi.py index cb56554..37fb045 100644 --- a/coworks/extension/jsonapi/jsonapi.py +++ b/coworks/extension/jsonapi/jsonapi.py @@ -9,7 +9,6 @@ from flask.typing import ResponseReturnValue from jsonapi_pydantic.v1_0 import Error from jsonapi_pydantic.v1_0 import ErrorLinks -from jsonapi_pydantic.v1_0 import Resource from jsonapi_pydantic.v1_0 import TopLevel from jsonapi_pydantic.v1_0.toplevel import Errors from pydantic import ValidationError @@ -93,7 +92,6 @@ def _handle_http_exception(e): errors = [Error(id=e.name, title=e.name, detail=e.description, status=e.code)] return toplevel_error_response(errors, status_code=InternalServerError.code) - def _handle_user_exception(e): if 'application/vnd.api+json' not in request.headers.getlist('accept'): return handle_user_exception(e) @@ -268,7 +266,7 @@ def toplevel_from_data(res: JsonApiDataMixin, include: set[str], exclude: set[st """ filtered_fields = fetching_context.field_names(res.jsonapi_type) | include data, included = res.to_resource(include=filtered_fields, exclude=exclude) - return TopLevel(data=Resource(**data), included=included.values() if included else None) + return TopLevel(data=data, included=included.values() if included else None) def toplevel_from_pagination(pagination: type[Pagination], include: set[str], exclude: set[str]): diff --git a/pyproject.toml b/pyproject.toml index 9396371..6990cf9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "pdm.backend" [project] name = "coworks" -version = "1.1.17" +version = "1.1.18" description = "CoWorks is a unified compositional microservices framework using Flask/Airflow on AWS serverless technologies." readme = "README.rst" requires-python = ">= 3.12"