Skip to content

Commit a36b49c

Browse files
committed
vendored openapi_schema_pydantic / correct flake8 warnings
- correct: W293, W291, F821
1 parent ec1a8bc commit a36b49c

21 files changed

+124
-126
lines changed

openapi_python_client/schema/openapi_schema_pydantic/__init__.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,36 +36,37 @@
3636
"ServerVariable",
3737
"Tag",
3838
"XML",
39+
"Callback",
3940
]
4041

4142

42-
from .open_api import OpenAPI
43-
from .info import Info
43+
from .callback import Callback
44+
from .components import Components
4445
from .contact import Contact
46+
from .discriminator import Discriminator
47+
from .encoding import Encoding
48+
from .example import Example
49+
from .external_documentation import ExternalDocumentation
50+
from .header import Header
51+
from .info import Info
4552
from .license import License
46-
from .server import Server
47-
from .server_variable import ServerVariable
48-
from .components import Components
49-
from .paths import Paths
50-
from .path_item import PathItem
53+
from .link import Link
54+
from .media_type import MediaType
55+
from .oauth_flow import OAuthFlow
56+
from .oauth_flows import OAuthFlows
57+
from .open_api import OpenAPI
5158
from .operation import Operation
52-
from .external_documentation import ExternalDocumentation
5359
from .parameter import Parameter
60+
from .path_item import PathItem
61+
from .paths import Paths
62+
from .reference import Reference
5463
from .request_body import RequestBody
55-
from .media_type import MediaType
56-
from .encoding import Encoding
57-
from .responses import Responses
5864
from .response import Response
59-
from .callback import Callback
60-
from .example import Example
61-
from .link import Link
62-
from .header import Header
63-
from .tag import Tag
64-
from .reference import Reference
65+
from .responses import Responses
6566
from .schema import Schema
66-
from .discriminator import Discriminator
67-
from .xml import XML
68-
from .security_scheme import SecurityScheme
69-
from .oauth_flows import OAuthFlows
70-
from .oauth_flow import OAuthFlow
7167
from .security_requirement import SecurityRequirement
68+
from .security_scheme import SecurityScheme
69+
from .server import Server
70+
from .server_variable import ServerVariable
71+
from .tag import Tag
72+
from .xml import XML

openapi_python_client/schema/openapi_schema_pydantic/callback.py

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

3-
4-
Callback = Dict[str, "PathItem"]
3+
Callback = Dict[str, "PathItem"] # noqa
54
"""
65
A map of possible out-of band callbacks related to the parent operation.
76
Each value in the map is a [Path Item Object](#pathItemObject)

openapi_python_client/schema/openapi_schema_pydantic/encoding.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@ class Encoding(BaseModel):
1212
"""
1313
The Content-Type for encoding a specific property.
1414
Default value depends on the property type:
15-
15+
1616
- for `string` with `format` being `binary` – `application/octet-stream`;
1717
- for other primitive types – `text/plain`;
1818
- for `object` - `application/json`;
1919
- for `array` – the default is defined based on the inner type.
20-
20+
2121
The value can be a specific media type (e.g. `application/json`), a wildcard media type (e.g. `image/*`),
2222
or a comma-separated list of the two types.
2323
"""
2424

25-
headers: Optional[Dict[str, Union["Header", Reference]]] = None
25+
headers: Optional[Dict[str, Union["Header", Reference]]] = None # noqa
2626
"""
2727
A map allowing additional information to be provided as headers, for example `Content-Disposition`.
28-
28+
2929
`Content-Type` is described separately and SHALL be ignored in this section.
3030
This property SHALL be ignored if the request body media type is not a `multipart`.
3131
"""
3232

3333
style: Optional[str] = None
3434
"""
3535
Describes how a specific property value will be serialized depending on its type.
36-
36+
3737
See [Parameter Object](#parameterObject) for details on the [`style`](#parameterStyle) property.
3838
The behavior follows the same values as `query` parameters, including default values.
3939
This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
@@ -43,7 +43,7 @@ class Encoding(BaseModel):
4343
"""
4444
When this is true, property values of type `array` or `object` generate separate parameters
4545
for each value of the array, or key-value-pair of the map.
46-
46+
4747
For other types of properties this property has no effect.
4848
When [`style`](#encodingStyle) is `form`, the default value is `true`.
4949
For all other styles, the default value is `false`.

openapi_python_client/schema/openapi_schema_pydantic/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Example(BaseModel):
2828
"""
2929
A URL that points to the literal example.
3030
This provides the capability to reference examples that cannot easily be included in JSON or YAML documents.
31-
31+
3232
The `value` field and `externalValue` field are mutually exclusive.
3333
"""
3434

openapi_python_client/schema/openapi_schema_pydantic/link.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Link(BaseModel):
3131
operationId: Optional[str] = None
3232
"""
3333
The name of an _existing_, resolvable OAS operation, as defined with a unique `operationId`.
34-
34+
3535
This field is mutually exclusive of the `operationRef` field.
3636
"""
3737

@@ -41,7 +41,7 @@ class Link(BaseModel):
4141
as specified with `operationId` or identified via `operationRef`.
4242
The key is the parameter name to be used,
4343
whereas the value can be a constant or an expression to be evaluated and passed to the linked operation.
44-
44+
4545
The parameter name can be qualified using the [parameter location](#parameterIn) `[{in}.]{name}`
4646
for operations that use the same parameter name in different locations (e.g. path.id).
4747
"""

openapi_python_client/schema/openapi_schema_pydantic/media_type.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ class MediaType(BaseModel):
1919
example: Optional[Any] = None
2020
"""
2121
Example of the media type.
22-
22+
2323
The example object SHOULD be in the correct format as specified by the media type.
24-
24+
2525
The `example` field is mutually exclusive of the `examples` field.
26-
26+
2727
Furthermore, if referencing a `schema` which contains an example,
2828
the `example` value SHALL _override_ the example provided by the schema.
2929
"""
3030

3131
examples: Optional[Dict[str, Union[Example, Reference]]] = None
3232
"""
3333
Examples of the media type.
34-
34+
3535
Each example object SHOULD match the media type and specified schema if present.
36-
36+
3737
The `examples` field is mutually exclusive of the `example` field.
38-
38+
3939
Furthermore, if referencing a `schema` which contains an example,
4040
the `examples` value SHALL _override_ the example provided by the schema.
4141
"""

openapi_python_client/schema/openapi_schema_pydantic/oauth_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Dict, Optional, Union
1+
from typing import Dict, Optional
22

33
from pydantic import AnyUrl, BaseModel, Extra
44

openapi_python_client/schema/openapi_schema_pydantic/oauth_flows.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ class OAuthFlows(BaseModel):
2323
clientCredentials: Optional[OAuthFlow] = None
2424
"""
2525
Configuration for the OAuth Client Credentials flow.
26-
26+
2727
Previously called `application` in OpenAPI 2.0.
2828
"""
2929

3030
authorizationCode: Optional[OAuthFlow] = None
3131
"""
3232
Configuration for the OAuth Authorization Code flow.
33-
33+
3434
Previously called `accessCode` in OpenAPI 2.0.
3535
"""
3636

openapi_python_client/schema/openapi_schema_pydantic/open_api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class OpenAPI(BaseModel):
2121

2222
servers: List[Server] = [Server(url="/")]
2323
"""
24-
An array of Server Objects, which provide connectivity information to a target server.
24+
An array of Server Objects, which provide connectivity information to a target server.
2525
If the `servers` property is not provided, or is an empty array,
2626
the default value would be a [Server Object](#serverObject) with a [url](#serverUrl) value of `/`.
2727
"""
@@ -38,10 +38,10 @@ class OpenAPI(BaseModel):
3838

3939
security: Optional[List[SecurityRequirement]] = None
4040
"""
41-
A declaration of which security mechanisms can be used across the API.
42-
The list of values includes alternative security requirement objects that can be used.
43-
Only one of the security requirement objects need to be satisfied to authorize a request.
44-
Individual operations can override this definition.
41+
A declaration of which security mechanisms can be used across the API.
42+
The list of values includes alternative security requirement objects that can be used.
43+
Only one of the security requirement objects need to be satisfied to authorize a request.
44+
Individual operations can override this definition.
4545
To make security optional, an empty security requirement (`{}`) can be included in the array.
4646
"""
4747

openapi_python_client/schema/openapi_schema_pydantic/operation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ class Operation(BaseModel):
5959

6060
requestBody: Optional[Union[RequestBody, Reference]] = None
6161
"""
62-
The request body applicable for this operation.
63-
62+
The request body applicable for this operation.
63+
6464
The `requestBody` is only supported in HTTP methods where the HTTP 1.1 specification
65-
[RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1) has explicitly defined semantics for request bodies.
65+
[RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1) has explicitly defined semantics for request bodies.
6666
In other cases where the HTTP spec is vague, `requestBody` SHALL be ignored by consumers.
6767
"""
6868

@@ -75,7 +75,7 @@ class Operation(BaseModel):
7575
"""
7676
A map of possible out-of band callbacks related to the parent operation.
7777
The key is a unique identifier for the Callback Object.
78-
Each value in the map is a [Callback Object](#callbackObject)
78+
Each value in the map is a [Callback Object](#callbackObject)
7979
that describes a request that may be initiated by the API provider and the expected responses.
8080
"""
8181

@@ -99,7 +99,7 @@ class Operation(BaseModel):
9999
servers: Optional[List[Server]] = None
100100
"""
101101
An alternative `server` array to service this operation.
102-
If an alternative `server` object is specified at the Path Item Object or Root level,
102+
If an alternative `server` object is specified at the Path Item Object or Root level,
103103
it will be overridden by this value.
104104
"""
105105

0 commit comments

Comments
 (0)