Skip to content

Commit 1955d8c

Browse files
committed
fix: Allow all URLs to be relative. Remove pointless unions.
1 parent 2143405 commit 1955d8c

File tree

13 files changed

+29
-33
lines changed

13 files changed

+29
-33
lines changed

openapi_pydantic/v3/v3_0_3/contact.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from pydantic import AnyUrl, BaseModel, Extra
3+
from pydantic import BaseModel, Extra
44

55

66
class Contact(BaseModel):
@@ -13,7 +13,7 @@ class Contact(BaseModel):
1313
The identifying name of the contact person/organization.
1414
"""
1515

16-
url: Optional[AnyUrl] = None
16+
url: Optional[str] = None
1717
"""
1818
The URL pointing to the contact information.
1919
MUST be in the format of a URL.

openapi_pydantic/v3/v3_0_3/external_documentation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from pydantic import AnyUrl, BaseModel, Extra
3+
from pydantic import BaseModel, Extra
44

55

66
class ExternalDocumentation(BaseModel):
@@ -13,7 +13,7 @@ class ExternalDocumentation(BaseModel):
1313
representation.
1414
"""
1515

16-
url: AnyUrl
16+
url: str
1717
"""
1818
**REQUIRED**. The URL for the target documentation.
1919
Value MUST be in the format of a URL.

openapi_pydantic/v3/v3_0_3/info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from pydantic import AnyUrl, BaseModel, Extra
3+
from pydantic import BaseModel, Extra
44

55
from .contact import Contact
66
from .license import License
@@ -25,7 +25,7 @@ class Info(BaseModel):
2525
representation.
2626
"""
2727

28-
termsOfService: Optional[AnyUrl] = None
28+
termsOfService: Optional[str] = None
2929
"""
3030
A URL to the Terms of Service for the API.
3131
MUST be in the format of a URL.

openapi_pydantic/v3/v3_0_3/license.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from pydantic import AnyUrl, BaseModel, Extra
3+
from pydantic import BaseModel, Extra
44

55

66
class License(BaseModel):
@@ -13,7 +13,7 @@ class License(BaseModel):
1313
**REQUIRED**. The license name used for the API.
1414
"""
1515

16-
url: Optional[AnyUrl] = None
16+
url: Optional[str] = None
1717
"""
1818
A URL to the license used for the API.
1919
MUST be in the format of a URL.

openapi_pydantic/v3/v3_0_3/oauth_flow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
from typing import Dict, Optional, Union
22

3-
from pydantic import AnyUrl, BaseModel, Extra
3+
from pydantic import BaseModel, Extra
44

55

66
class OAuthFlow(BaseModel):
77
"""
88
Configuration details for a supported OAuth Flow
99
"""
1010

11-
authorizationUrl: Optional[Union[AnyUrl, str]] = None
11+
authorizationUrl: Optional[str] = None
1212
"""
1313
**REQUIRED** for `oauth2 ("implicit", "authorizationCode")`.
1414
The authorization URL to be used for this flow.
1515
This MUST be in the form of a URL.
1616
"""
1717

18-
tokenUrl: Optional[Union[AnyUrl, str]] = None
18+
tokenUrl: Optional[str] = None
1919
"""
2020
**REQUIRED** for `oauth2 ("password", "clientCredentials", "authorizationCode")`.
2121
The token URL to be used for this flow.
2222
This MUST be in the form of a URL.
2323
"""
2424

25-
refreshUrl: Optional[Union[AnyUrl, str]] = None
25+
refreshUrl: Optional[str] = None
2626
"""
2727
The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL.
2828
"""

openapi_pydantic/v3/v3_0_3/security_scheme.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional, Union
22

3-
from pydantic import AnyUrl, BaseModel, Extra, Field
3+
from pydantic import BaseModel, Extra, Field
44

55
from .oauth_flows import OAuthFlows
66

@@ -63,7 +63,7 @@ class SecurityScheme(BaseModel):
6363
flow types supported.
6464
"""
6565

66-
openIdConnectUrl: Optional[Union[AnyUrl, str]] = None
66+
openIdConnectUrl: Optional[str] = None
6767
"""
6868
**REQUIRED** for `openIdConnect`. OpenId Connect URL to discover OAuth2
6969
configuration values. This MUST be in the form of a URL.

openapi_pydantic/v3/v3_1_0/contact.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from pydantic import AnyUrl, BaseModel, Extra
3+
from pydantic import BaseModel, Extra
44

55

66
class Contact(BaseModel):
@@ -13,7 +13,7 @@ class Contact(BaseModel):
1313
The identifying name of the contact person/organization.
1414
"""
1515

16-
url: Optional[AnyUrl] = None
16+
url: Optional[str] = None
1717
"""
1818
The URL pointing to the contact information.
1919
MUST be in the form of a URL.

openapi_pydantic/v3/v3_1_0/external_documentation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from pydantic import AnyUrl, BaseModel, Extra
3+
from pydantic import BaseModel, Extra
44

55

66
class ExternalDocumentation(BaseModel):
@@ -13,7 +13,7 @@ class ExternalDocumentation(BaseModel):
1313
representation.
1414
"""
1515

16-
url: AnyUrl
16+
url: str
1717
"""
1818
**REQUIRED**. The URL for the target documentation.
1919
Value MUST be in the form of a URL.

openapi_pydantic/v3/v3_1_0/info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from pydantic import AnyUrl, BaseModel, Extra
3+
from pydantic import BaseModel, Extra
44

55
from .contact import Contact
66
from .license import License
@@ -30,7 +30,7 @@ class Info(BaseModel):
3030
representation.
3131
"""
3232

33-
termsOfService: Optional[AnyUrl] = None
33+
termsOfService: Optional[str] = None
3434
"""
3535
A URL to the Terms of Service for the API.
3636
MUST be in the form of a URL.

openapi_pydantic/v3/v3_1_0/license.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from pydantic import AnyUrl, BaseModel, Extra
3+
from pydantic import BaseModel, Extra
44

55

66
class License(BaseModel):
@@ -20,7 +20,7 @@ class License(BaseModel):
2020
`url` field.
2121
"""
2222

23-
url: Optional[AnyUrl] = None
23+
url: Optional[str] = None
2424
"""
2525
A URL to the license used for the API.
2626
This MUST be in the form of a URL.

0 commit comments

Comments
 (0)