Skip to content

Commit

Permalink
Update openapi-pydantic to 0.5.0 (#319)
Browse files Browse the repository at this point in the history
* Update openapi-pydantic to 0.5.0

* Update github coverage download-artifact to v2

* Update github coverage download-artifact to v4

* Update github coverage download-artifact to v3

* Fix coverage actions path

* Debug GH actions

* Debug GH actions step 2

* Debug GH actions step 3

* Debug GH actions step 4

* Fix GH actions related to coverage
  • Loading branch information
EvgenySmekalin authored Nov 5, 2024
1 parent 28c5fdb commit 40e50d0
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 33 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: coverage-reports
include-hidden-files: true
path: ".coverage.${{ matrix.python-version }}"

coverage-check:
Expand All @@ -59,9 +60,10 @@ jobs:
run: |
pip3 install coverage==7.2.3
- name: Download coverage reports
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: coverage-reports
path: coverage-reports
- name: Combine reports
run: |
coverage combine coverage-reports
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [28.0.0] - 2024-11-05
- Update to openapi-pydantic 0.5.0

## [26.0.1] - 2024-08-15
- Remove unexpected openapi attributes from path and query parameters

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "winter"
version = "27.0.0"
version = "28.0.0"
homepage = "https://github.com/WinterFramework/winter"
description = "Web Framework with focus on python typing, dataclasses and modular design"
authors = ["Alexander Egorov <[email protected]>"]
Expand Down Expand Up @@ -40,7 +40,7 @@ injector = ">=0.15.0, <1"
SQLAlchemy = ">=1.3, <2"
typing-extensions = "^4.8"
StrEnum = "^0.4.8"
openapi-pydantic = ">=0.4.1, <1"
openapi-pydantic = ">=0.5.0, <0.6"
pydantic = ">=1.10, <2"
openapi-spec-validator = ">=0.5.7, <1"
uritemplate = ">=4.1.1, <5"
Expand Down
2 changes: 1 addition & 1 deletion tests/winter_openapi/test_add_url_segment_as_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_resource(self): # pragma: no cover
assert result == {
'components': {'parameters': {}, 'responses': {}, 'schemas': {}},
'info': {'description': 'description', 'title': 'title', 'version': '1.0.0'},
'openapi': '3.0.3',
'openapi': '3.0.4',
'paths': {
'/resource': {
'get': {
Expand Down
4 changes: 2 additions & 2 deletions tests/winter_openapi/test_api_request_and_response_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def method_request_body_undefined_2(self, data: DataclassWithUndefined):
},
},
'info': {'title': 'title', 'version': '1.0.0'},
'openapi': '3.0.3',
'openapi': '3.0.4',
'paths': {
'/method_return_1/': {
'get': {
Expand Down Expand Up @@ -985,7 +985,7 @@ def method_2(self) -> Page[str]:
},
},
'info': {'title': 'title', 'version': '1.0.0'},
'openapi': '3.0.3',
'openapi': '3.0.4',
'paths': {
'/method_1/': {
'get': {
Expand Down
4 changes: 2 additions & 2 deletions tests/winter_openapi/test_exception_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_resource(self): # pragma: no cover
assert result == {
'components': {'parameters': {}, 'responses': {}, 'schemas': {}},
'info': {'title': 'title', 'version': '1.0.0'},
'openapi': '3.0.3',
'openapi': '3.0.4',
'paths': {
'/resource': {
'get': {
Expand Down Expand Up @@ -114,7 +114,7 @@ def get_resource(self): # pragma: no cover
assert result == {
'components': expected_components,
'info': {'title': 'title', 'version': '1.0.0'},
'openapi': '3.0.3',
'openapi': '3.0.4',
'paths': {
'/resource': {
'get': {
Expand Down
2 changes: 1 addition & 1 deletion tests/winter_openapi/test_metadata_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def get_resource(self): # pragma: no cover
assert result == {
'components': {'parameters': {}, 'responses': {}, 'schemas': {}},
'info': {'description': 'description', 'title': 'title', 'version': '1.0.0'},
'openapi': '3.0.3',
'openapi': '3.0.4',
'paths': {
'/resource': {
'get': {
Expand Down
5 changes: 0 additions & 5 deletions tests/winter_openapi/test_page_position_argument_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def method(self, arg1: PagePosition): # pragma: no cover
"allowReserved": False,
"deprecated": False,
"description": "Number of results to return per page",
"explode": False,
"in": "query",
"name": "limit",
"required": False,
Expand All @@ -36,7 +35,6 @@ def method(self, arg1: PagePosition): # pragma: no cover
"allowReserved": False,
"deprecated": False,
"description": "The initial index from which to return the results",
"explode": False,
"in": "query",
"name": "offset",
"required": False,
Expand Down Expand Up @@ -75,7 +73,6 @@ def method(self, arg1: PagePosition): # pragma: no cover
"allowReserved": False,
"deprecated": False,
"description": "Comma separated order by fields. Allowed fields: id.",
"explode": False,
"in": "query",
"name": "order_by",
"required": False,
Expand All @@ -96,7 +93,6 @@ def method(self, arg1: PagePosition): # pragma: no cover
"allowReserved": False,
"deprecated": False,
"description": "Number of results to return per page",
"explode": False,
"in": "query",
"name": "limit",
"required": False,
Expand All @@ -107,7 +103,6 @@ def method(self, arg1: PagePosition): # pragma: no cover
"allowReserved": False,
"deprecated": False,
"description": "The initial index from which to return the results",
"explode": False,
"in": "query",
"name": "offset",
"required": False,
Expand Down
1 change: 0 additions & 1 deletion tests/winter_openapi/test_query_and_path_parameter_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def simple_method_with_path_param(
'allowEmptyValue': False,
'allowReserved': False,
'deprecated': False,
'explode': False,
'description': 'docstr',
**expected_parameter_properties,
}
Expand Down
30 changes: 15 additions & 15 deletions winter_openapi/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@

from django.http.response import HttpResponseBase
from openapi_pydantic import schema_validate
from openapi_pydantic.v3.v3_0_3 import Components
from openapi_pydantic.v3.v3_0_3 import Info
from openapi_pydantic.v3.v3_0_3 import MediaType as MediaTypeModel
from openapi_pydantic.v3.v3_0_3 import OpenAPI
from openapi_pydantic.v3.v3_0_3 import Operation
from openapi_pydantic.v3.v3_0_3 import Parameter
from openapi_pydantic.v3.v3_0_3 import PathItem
from openapi_pydantic.v3.v3_0_3 import Paths
from openapi_pydantic.v3.v3_0_3 import Reference
from openapi_pydantic.v3.v3_0_3 import RequestBody
from openapi_pydantic.v3.v3_0_3 import Response
from openapi_pydantic.v3.v3_0_3 import Responses
from openapi_pydantic.v3.v3_0_3 import Schema
from openapi_pydantic.v3.v3_0_3 import Server
from openapi_pydantic.v3.v3_0_3 import Tag
from openapi_pydantic.v3.v3_0 import Components
from openapi_pydantic.v3.v3_0 import Info
from openapi_pydantic.v3.v3_0 import MediaType as MediaTypeModel
from openapi_pydantic.v3.v3_0 import OpenAPI
from openapi_pydantic.v3.v3_0 import Operation
from openapi_pydantic.v3.v3_0 import Parameter
from openapi_pydantic.v3.v3_0 import PathItem
from openapi_pydantic.v3.v3_0 import Paths
from openapi_pydantic.v3.v3_0 import Reference
from openapi_pydantic.v3.v3_0 import RequestBody
from openapi_pydantic.v3.v3_0 import Response
from openapi_pydantic.v3.v3_0 import Responses
from openapi_pydantic.v3.v3_0 import Schema
from openapi_pydantic.v3.v3_0 import Server
from openapi_pydantic.v3.v3_0 import Tag

from winter.core import ComponentMethod
from winter.web import MediaType
Expand Down
4 changes: 2 additions & 2 deletions winter_openapi/inspectors/page_position_argument_inspector.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List
from typing import TYPE_CHECKING

from openapi_pydantic.v3.v3_0_3 import Parameter
from openapi_pydantic.v3.v3_0_3 import Schema
from openapi_pydantic.v3.v3_0 import Parameter
from openapi_pydantic.v3.v3_0 import Schema

from winter.data.pagination import PagePosition
from winter.web.pagination.order_by import OrderByAnnotation
Expand Down
2 changes: 1 addition & 1 deletion winter_openapi/inspectors/path_parameters_inspector.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List
from typing import TYPE_CHECKING

from openapi_pydantic.v3.v3_0_3 import Parameter
from openapi_pydantic.v3.v3_0 import Parameter

from winter.core import ComponentMethodArgument
from winter.web.routing import Route
Expand Down

0 comments on commit 40e50d0

Please sign in to comment.