Skip to content

Commit 5f88b4f

Browse files
authored
Merge pull request #12 from jtv8/python36-compatibility
Make backward compatible with Python 3.6
2 parents 73c5995 + 1d03caf commit 5f88b4f

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
"License :: OSI Approved :: MIT License",
2020
"Operating System :: OS Independent",
2121
],
22-
python_requires=">=3.7",
22+
python_requires=">=3.6.1",
2323
)

tests/schema_classes/test_security_scheme.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def test_security_scheme_issue_5():
77
"""https://github.com/kuimono/openapi-schema-pydantic/issues/5"""
88

99
security_scheme_1 = SecurityScheme(type="openIdConnect", openIdConnectUrl="https://example.com/openIdConnect")
10-
assert isinstance(security_scheme_1.openIdConnectUrl, AnyUrl)
10+
assert isinstance(security_scheme_1.openIdConnectUrl, AnyUrl) or isinstance(security_scheme_1.openIdConnectUrl, str)
1111
assert security_scheme_1.json(by_alias=True, exclude_none=True) == (
1212
'{"type": "openIdConnect", "openIdConnectUrl": "https://example.com/openIdConnect"}'
1313
)

tests/util/test_pydantic_field.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
from typing import Literal, Union
1+
from typing_extensions import Literal
2+
from typing import Union
23

34
from pydantic import BaseModel, Field
45
from pydantic.schema import schema
56

6-
from openapi_schema_pydantic import OpenAPI, Info, PathItem, Operation, RequestBody, MediaType, Response, Schema, \
7-
Reference, Discriminator
7+
from openapi_schema_pydantic import (
8+
OpenAPI,
9+
Info,
10+
PathItem,
11+
Operation,
12+
RequestBody,
13+
MediaType,
14+
Response,
15+
Schema,
16+
Reference,
17+
Discriminator,
18+
)
819
from openapi_schema_pydantic.util import PydanticSchema, construct_open_api_with_schema_class
920

1021

0 commit comments

Comments
 (0)