openapi3-parser 1.1.15__tar.gz → 1.1.17__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/PKG-INFO +1 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi3_parser.egg-info/PKG-INFO +1 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/__init__.py +1 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/external_doc.py +6 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/header.py +5 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/info.py +5 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/oauth_flow.py +9 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/operation.py +5 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/parameter.py +6 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/path.py +10 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/security.py +5 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/server.py +5 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/enumeration.py +7 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/specification.py +11 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/tests/test_enumeration.py +7 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/tests/test_runner.py +1 -1
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/license.txt +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/setup.cfg +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/setup.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi3_parser.egg-info/SOURCES.txt +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi3_parser.egg-info/dependency_links.txt +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi3_parser.egg-info/requires.txt +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi3_parser.egg-info/top_level.txt +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/__init__.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/common.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/content.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/request.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/response.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/schema.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/schemas.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/tag.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/errors.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/loose_types.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/parser.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/py.typed +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/resolver.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/tests/test_parser.py +0 -0
- {openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/tests/test_parser_options.py +0 -0
{openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi_parser/builders/external_doc.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
+
from .common import extract_extension_attributes
|
|
3
4
|
from ..specification import ExternalDoc
|
|
4
5
|
|
|
5
6
|
logger = logging.getLogger(__name__)
|
|
@@ -12,7 +13,11 @@ class ExternalDocBuilder:
|
|
|
12
13
|
|
|
13
14
|
attrs = {
|
|
14
15
|
"url": data['url'],
|
|
15
|
-
"description": data.get('description')
|
|
16
|
+
"description": data.get('description'),
|
|
17
|
+
"extensions": extract_extension_attributes(data),
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
if attrs['extensions']:
|
|
21
|
+
logger.debug(f"Extracted custom properties [{attrs['extensions'].keys()}]")
|
|
22
|
+
|
|
18
23
|
return ExternalDoc(**attrs)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
3
|
from . import SchemaFactory
|
|
4
|
-
from .common import extract_typed_props, PropertyMeta
|
|
4
|
+
from .common import extract_typed_props, PropertyMeta, extract_extension_attributes
|
|
5
5
|
from ..specification import Header
|
|
6
6
|
|
|
7
7
|
logger = logging.getLogger(__name__)
|
|
@@ -33,5 +33,9 @@ class HeaderBuilder:
|
|
|
33
33
|
attrs = extract_typed_props(data, attrs_map)
|
|
34
34
|
|
|
35
35
|
attrs['name'] = name
|
|
36
|
+
attrs["extensions"] = extract_extension_attributes(data)
|
|
37
|
+
|
|
38
|
+
if attrs['extensions']:
|
|
39
|
+
logger.debug(f"Extracted custom properties [{attrs['extensions'].keys()}]")
|
|
36
40
|
|
|
37
41
|
return Header(**attrs)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
from .common import extract_typed_props, PropertyMeta
|
|
3
|
+
from .common import extract_typed_props, PropertyMeta, extract_extension_attributes
|
|
4
4
|
from ..specification import Contact, Info, License
|
|
5
5
|
|
|
6
6
|
logger = logging.getLogger(__name__)
|
|
@@ -20,6 +20,10 @@ class InfoBuilder:
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
attrs = extract_typed_props(data, attrs_map)
|
|
23
|
+
attrs["extensions"] = extract_extension_attributes(data)
|
|
24
|
+
|
|
25
|
+
if attrs['extensions']:
|
|
26
|
+
logger.debug(f"Extracted custom properties [{attrs['extensions'].keys()}]")
|
|
23
27
|
|
|
24
28
|
return Info(**attrs)
|
|
25
29
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from typing import Dict
|
|
3
3
|
|
|
4
|
-
from .common import extract_typed_props, PropertyMeta
|
|
4
|
+
from .common import extract_typed_props, PropertyMeta, extract_extension_attributes
|
|
5
5
|
from ..enumeration import OAuthFlowType
|
|
6
6
|
from ..specification import OAuthFlow
|
|
7
7
|
|
|
@@ -22,10 +22,18 @@ class OAuthFlowBuilder:
|
|
|
22
22
|
|
|
23
23
|
result_oauth_dict = {
|
|
24
24
|
OAuthFlowType(oauth_type): OAuthFlow(
|
|
25
|
+
extensions=extract_extension_attributes(oauth_value),
|
|
25
26
|
**extract_typed_props(oauth_value, attrs_map)
|
|
26
27
|
)
|
|
27
28
|
for oauth_type, oauth_value
|
|
28
29
|
in data.items()
|
|
30
|
+
if not oauth_type.startswith("x-")
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
extensions = extract_extension_attributes(data)
|
|
34
|
+
if extensions:
|
|
35
|
+
logger.debug(f"Extracted custom properties [{extensions.keys()}]")
|
|
36
|
+
for extension in extensions.keys():
|
|
37
|
+
result_oauth_dict[extension] = extensions[extension]
|
|
38
|
+
|
|
31
39
|
return result_oauth_dict
|
|
@@ -2,7 +2,7 @@ import logging
|
|
|
2
2
|
from typing import Dict
|
|
3
3
|
|
|
4
4
|
from . import ExternalDocBuilder, ParameterBuilder, RequestBuilder, ResponseBuilder
|
|
5
|
-
from .common import extract_typed_props, PropertyMeta
|
|
5
|
+
from .common import extract_typed_props, PropertyMeta, extract_extension_attributes
|
|
6
6
|
from ..enumeration import OperationMethod
|
|
7
7
|
from ..specification import Operation, Response
|
|
8
8
|
|
|
@@ -42,6 +42,10 @@ class OperationBuilder:
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
attrs = extract_typed_props(data, attrs_map)
|
|
45
|
+
attrs['extensions'] = extract_extension_attributes(data)
|
|
46
|
+
|
|
47
|
+
if attrs['extensions']:
|
|
48
|
+
logger.debug(f"Extracted custom properties [{attrs['extensions'].keys()}]")
|
|
45
49
|
|
|
46
50
|
attrs['method'] = method
|
|
47
51
|
|
|
@@ -2,7 +2,7 @@ import logging
|
|
|
2
2
|
from typing import List
|
|
3
3
|
|
|
4
4
|
from . import SchemaFactory
|
|
5
|
-
from .common import extract_typed_props, PropertyMeta
|
|
5
|
+
from .common import extract_typed_props, PropertyMeta, extract_extension_attributes
|
|
6
6
|
from ..enumeration import ParameterLocation, HeaderParameterStyle, PathParameterStyle, QueryParameterStyle, \
|
|
7
7
|
CookieParameterStyle
|
|
8
8
|
from ..specification import Parameter
|
|
@@ -56,4 +56,9 @@ class ParameterBuilder:
|
|
|
56
56
|
if not attrs.get("explode") and attrs["style"].value == "form":
|
|
57
57
|
attrs["explode"] = True
|
|
58
58
|
|
|
59
|
+
attrs['extensions'] = extract_extension_attributes(data)
|
|
60
|
+
|
|
61
|
+
if attrs['extensions']:
|
|
62
|
+
logger.debug(f"Extracted custom properties [{attrs['extensions'].keys()}]")
|
|
63
|
+
|
|
59
64
|
return Parameter(**attrs)
|
|
@@ -2,7 +2,7 @@ import logging
|
|
|
2
2
|
from typing import Dict
|
|
3
3
|
|
|
4
4
|
from . import OperationBuilder, ParameterBuilder
|
|
5
|
-
from .common import extract_typed_props, PropertyMeta
|
|
5
|
+
from .common import extract_typed_props, PropertyMeta, extract_extension_attributes
|
|
6
6
|
from ..enumeration import OperationMethod
|
|
7
7
|
from ..specification import Path
|
|
8
8
|
|
|
@@ -42,4 +42,13 @@ class PathBuilder:
|
|
|
42
42
|
if method.value in data
|
|
43
43
|
]
|
|
44
44
|
|
|
45
|
+
if attrs.get("parameters"):
|
|
46
|
+
for operation in attrs["operations"]:
|
|
47
|
+
operation.parameters += attrs["parameters"]
|
|
48
|
+
|
|
49
|
+
attrs['extensions'] = extract_extension_attributes(data)
|
|
50
|
+
|
|
51
|
+
if attrs['extensions']:
|
|
52
|
+
logger.debug(f"Extracted custom properties [{attrs['extensions'].keys()}]")
|
|
53
|
+
|
|
45
54
|
return Path(**attrs)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
from .common import extract_typed_props, PropertyMeta
|
|
3
|
+
from .common import extract_typed_props, PropertyMeta, extract_extension_attributes
|
|
4
4
|
from .oauth_flow import OAuthFlowBuilder
|
|
5
5
|
from ..enumeration import AuthenticationScheme, BaseLocation, SecurityType
|
|
6
6
|
from ..specification import Security
|
|
@@ -29,6 +29,10 @@ class SecurityBuilder:
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
attrs = extract_typed_props(data, attrs_map)
|
|
32
|
+
attrs['extensions'] = extract_extension_attributes(data)
|
|
33
|
+
|
|
34
|
+
if attrs['extensions']:
|
|
35
|
+
logger.debug(f"Extracted custom properties [{attrs['extensions'].keys()}]")
|
|
32
36
|
|
|
33
37
|
return Security(**attrs)
|
|
34
38
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
from .common import extract_typed_props, PropertyMeta
|
|
3
|
+
from .common import extract_typed_props, PropertyMeta, extract_extension_attributes
|
|
4
4
|
from ..specification import Server
|
|
5
5
|
|
|
6
6
|
logger = logging.getLogger(__name__)
|
|
@@ -21,5 +21,9 @@ class ServerBuilder:
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
attrs = extract_typed_props(data, attrs_map)
|
|
24
|
+
attrs['extensions'] = extract_extension_attributes(data)
|
|
25
|
+
|
|
26
|
+
if attrs['extensions']:
|
|
27
|
+
logger.debug(f"Extracted custom properties [{attrs['extensions'].keys()}]")
|
|
24
28
|
|
|
25
29
|
return Server(**attrs)
|
|
@@ -107,6 +107,13 @@ class ContentType(Enum):
|
|
|
107
107
|
HTML = 'text/html'
|
|
108
108
|
PDF = 'application/pdf'
|
|
109
109
|
PNG = 'image/png'
|
|
110
|
+
JPEG = 'image/jpeg'
|
|
111
|
+
GIF = 'image/gif'
|
|
112
|
+
SVG = 'image/svg+xml'
|
|
113
|
+
AVIF = 'image/avif'
|
|
114
|
+
BMP = 'image/bmp'
|
|
115
|
+
WEBP = 'image/webp'
|
|
116
|
+
Image = 'image/*'
|
|
110
117
|
BINARY = 'application/octet-stream'
|
|
111
118
|
|
|
112
119
|
|
|
@@ -21,6 +21,7 @@ class Contact:
|
|
|
21
21
|
class License:
|
|
22
22
|
name: str
|
|
23
23
|
url: Optional[str] = None
|
|
24
|
+
extensions: Optional[dict] = field(default_factory=dict)
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
@dataclass
|
|
@@ -31,6 +32,7 @@ class Info:
|
|
|
31
32
|
terms_of_service: Optional[str] = None
|
|
32
33
|
contact: Optional[Contact] = None
|
|
33
34
|
license: Optional[License] = None
|
|
35
|
+
extensions: Optional[dict] = field(default_factory=dict)
|
|
34
36
|
|
|
35
37
|
|
|
36
38
|
@dataclass
|
|
@@ -38,12 +40,14 @@ class Server:
|
|
|
38
40
|
url: str
|
|
39
41
|
description: Optional[str] = None
|
|
40
42
|
variables: Optional[dict] = field(default_factory=dict)
|
|
43
|
+
extensions: Optional[dict] = field(default_factory=dict)
|
|
41
44
|
|
|
42
45
|
|
|
43
46
|
@dataclass
|
|
44
47
|
class ExternalDoc:
|
|
45
48
|
url: str
|
|
46
49
|
description: Optional[str] = None
|
|
50
|
+
extensions: Optional[dict] = field(default_factory=dict)
|
|
47
51
|
|
|
48
52
|
|
|
49
53
|
@dataclass
|
|
@@ -157,6 +161,7 @@ class Parameter:
|
|
|
157
161
|
deprecated: Optional[bool] = field(default=False)
|
|
158
162
|
style: Optional[str] = None
|
|
159
163
|
explode: Optional[bool] = field(default=False)
|
|
164
|
+
extensions: Optional[dict] = field(default_factory=dict)
|
|
160
165
|
|
|
161
166
|
|
|
162
167
|
@dataclass
|
|
@@ -182,6 +187,7 @@ class Header:
|
|
|
182
187
|
description: Optional[str] = None
|
|
183
188
|
required: Optional[bool] = field(default=False)
|
|
184
189
|
deprecated: Optional[bool] = field(default=False)
|
|
190
|
+
extensions: Optional[dict] = field(default_factory=dict)
|
|
185
191
|
|
|
186
192
|
|
|
187
193
|
@dataclass
|
|
@@ -200,6 +206,7 @@ class OAuthFlow:
|
|
|
200
206
|
authorization_url: Optional[str] = None
|
|
201
207
|
token_url: Optional[str] = None
|
|
202
208
|
scopes: dict[str, str] = field(default_factory=dict)
|
|
209
|
+
extensions: Optional[dict] = field(default_factory=dict)
|
|
203
210
|
|
|
204
211
|
|
|
205
212
|
@dataclass
|
|
@@ -212,6 +219,7 @@ class Security:
|
|
|
212
219
|
bearer_format: Optional[str] = None
|
|
213
220
|
flows: dict[OAuthFlowType, OAuthFlow] = field(default_factory=dict)
|
|
214
221
|
url: Optional[str] = None
|
|
222
|
+
extensions: Optional[dict] = field(default_factory=dict)
|
|
215
223
|
|
|
216
224
|
|
|
217
225
|
@dataclass
|
|
@@ -227,6 +235,7 @@ class Operation:
|
|
|
227
235
|
parameters: list[Parameter] = field(default_factory=list)
|
|
228
236
|
tags: list[str] = field(default_factory=list)
|
|
229
237
|
security: list[dict[str, Any]] = field(default_factory=list)
|
|
238
|
+
extensions: Optional[dict] = field(default_factory=dict)
|
|
230
239
|
# callbacks: dict[str, Callback] = field(default_factory=dict) # TODO
|
|
231
240
|
|
|
232
241
|
|
|
@@ -237,6 +246,7 @@ class Path:
|
|
|
237
246
|
description: Optional[str] = None
|
|
238
247
|
operations: list[Operation] = field(default_factory=list)
|
|
239
248
|
parameters: list[Parameter] = field(default_factory=list)
|
|
249
|
+
extensions: Optional[dict] = field(default_factory=dict)
|
|
240
250
|
|
|
241
251
|
|
|
242
252
|
@dataclass
|
|
@@ -257,3 +267,4 @@ class Specification:
|
|
|
257
267
|
schemas: dict[str, Schema] = field(default_factory=dict)
|
|
258
268
|
external_docs: Optional[ExternalDoc] = None
|
|
259
269
|
paths: list[Path] = field(default_factory=list)
|
|
270
|
+
extensions: Optional[dict] = field(default_factory=dict)
|
|
@@ -149,6 +149,13 @@ media_type_provider = (
|
|
|
149
149
|
("text/html", ContentType.HTML),
|
|
150
150
|
("application/pdf", ContentType.PDF),
|
|
151
151
|
("image/png", ContentType.PNG),
|
|
152
|
+
("image/jpeg", ContentType.JPEG),
|
|
153
|
+
("image/gif", ContentType.GIF),
|
|
154
|
+
("image/svg+xml", ContentType.SVG),
|
|
155
|
+
("image/avif", ContentType.AVIF),
|
|
156
|
+
("image/bmp", ContentType.BMP),
|
|
157
|
+
("image/webp", ContentType.WEBP),
|
|
158
|
+
("image/*", ContentType.Image),
|
|
152
159
|
("application/octet-stream", ContentType.BINARY),
|
|
153
160
|
)
|
|
154
161
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi3_parser.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{openapi3-parser-1.1.15 → openapi3-parser-1.1.17}/src/openapi3_parser.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|