openapi3-parser 1.1.14__tar.gz → 1.1.16__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.
Files changed (40) hide show
  1. openapi3-parser-1.1.16/PKG-INFO +20 -0
  2. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/setup.cfg +2 -0
  3. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/setup.py +0 -6
  4. openapi3-parser-1.1.16/src/openapi3_parser.egg-info/PKG-INFO +20 -0
  5. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/__init__.py +1 -1
  6. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/enumeration.py +8 -0
  7. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/tests/test_enumeration.py +8 -0
  8. openapi3-parser-1.1.14/PKG-INFO +0 -96
  9. openapi3-parser-1.1.14/src/openapi3_parser.egg-info/PKG-INFO +0 -96
  10. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/license.txt +0 -0
  11. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi3_parser.egg-info/SOURCES.txt +0 -0
  12. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi3_parser.egg-info/dependency_links.txt +0 -0
  13. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi3_parser.egg-info/requires.txt +0 -0
  14. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi3_parser.egg-info/top_level.txt +0 -0
  15. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/__init__.py +0 -0
  16. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/common.py +0 -0
  17. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/content.py +0 -0
  18. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/external_doc.py +0 -0
  19. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/header.py +0 -0
  20. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/info.py +0 -0
  21. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/oauth_flow.py +0 -0
  22. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/operation.py +0 -0
  23. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/parameter.py +0 -0
  24. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/path.py +0 -0
  25. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/request.py +0 -0
  26. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/response.py +0 -0
  27. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/schema.py +0 -0
  28. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/schemas.py +0 -0
  29. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/security.py +0 -0
  30. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/server.py +0 -0
  31. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/builders/tag.py +0 -0
  32. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/errors.py +0 -0
  33. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/loose_types.py +0 -0
  34. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/parser.py +0 -0
  35. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/py.typed +0 -0
  36. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/resolver.py +0 -0
  37. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/src/openapi_parser/specification.py +0 -0
  38. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/tests/test_parser.py +0 -0
  39. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/tests/test_parser_options.py +0 -0
  40. {openapi3-parser-1.1.14 → openapi3-parser-1.1.16}/tests/test_runner.py +0 -0
@@ -0,0 +1,20 @@
1
+ Metadata-Version: 2.1
2
+ Name: openapi3-parser
3
+ Version: 1.1.16
4
+ Summary: OpenAPI v3 parser
5
+ Home-page: https://github.com/manchenkoff/openapi3-parser
6
+ Author: Artem Manchenkov
7
+ Author-email: artem@manchenkoff.me
8
+ License: MIT
9
+ Project-URL: Source, https://github.com/manchenkoff/openapi3-parser
10
+ Keywords: swagger,python,swagger-parser,openapi3-parser,parser,openapi3,swagger-api
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Topic :: Software Development :: Libraries
17
+ Description-Content-Type: text/markdown
18
+ License-File: license.txt
19
+ Requires-Dist: prance>=0.20.2
20
+ Requires-Dist: openapi-spec-validator==0.6.0
@@ -1,5 +1,7 @@
1
1
  [metadata]
2
2
  license_files = license.txt
3
+ long_description = file: README.md
4
+ long_description_content_type = text/markdown
3
5
 
4
6
  [mypy]
5
7
  python_version = 3.9
@@ -1,13 +1,9 @@
1
1
  #!/usr/bin/env python
2
2
 
3
- from os.path import dirname, join
4
-
5
3
  from setuptools import find_packages, setup
6
4
 
7
5
  from src import openapi_parser
8
6
 
9
- description_file = join(dirname(__file__), "readme.md")
10
-
11
7
  setup(
12
8
  name=openapi_parser.__title__,
13
9
  author=openapi_parser.__author__,
@@ -22,8 +18,6 @@ setup(
22
18
  package_data={"openapi_parser": ["py.typed"]},
23
19
  license="MIT",
24
20
  description=openapi_parser.__description__,
25
- long_description=open(description_file).read(),
26
- long_description_content_type="text/markdown",
27
21
  keywords="swagger, python, swagger-parser, openapi3-parser, parser, openapi3, swagger-api",
28
22
  classifiers=[
29
23
  'Development Status :: 4 - Beta',
@@ -0,0 +1,20 @@
1
+ Metadata-Version: 2.1
2
+ Name: openapi3-parser
3
+ Version: 1.1.16
4
+ Summary: OpenAPI v3 parser
5
+ Home-page: https://github.com/manchenkoff/openapi3-parser
6
+ Author: Artem Manchenkov
7
+ Author-email: artem@manchenkoff.me
8
+ License: MIT
9
+ Project-URL: Source, https://github.com/manchenkoff/openapi3-parser
10
+ Keywords: swagger,python,swagger-parser,openapi3-parser,parser,openapi3,swagger-api
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Topic :: Software Development :: Libraries
17
+ Description-Content-Type: text/markdown
18
+ License-File: license.txt
19
+ Requires-Dist: prance>=0.20.2
20
+ Requires-Dist: openapi-spec-validator==0.6.0
@@ -1,4 +1,4 @@
1
- __version__ = '1.1.14'
1
+ __version__ = '1.1.16'
2
2
  __title__ = 'openapi3-parser'
3
3
  __author__ = 'Artem Manchenkov'
4
4
  __email__ = 'artem@manchenkoff.me'
@@ -99,6 +99,7 @@ class ContentType(Enum):
99
99
  JSON = 'application/json'
100
100
  JSON_TEXT = 'text/json'
101
101
  JSON_ANY = 'application/*+json'
102
+ JSON_PROBLEM = 'application/problem+json'
102
103
  XML = 'application/xml'
103
104
  FORM = 'application/x-www-form-urlencoded'
104
105
  MULTIPART_FORM = 'multipart/form-data'
@@ -106,6 +107,13 @@ class ContentType(Enum):
106
107
  HTML = 'text/html'
107
108
  PDF = 'application/pdf'
108
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/*'
109
117
  BINARY = 'application/octet-stream'
110
118
 
111
119
 
@@ -140,6 +140,7 @@ def test_parameter_location_error() -> None:
140
140
  media_type_provider = (
141
141
  ("application/json", ContentType.JSON),
142
142
  ("application/*+json", ContentType.JSON_ANY),
143
+ ("application/problem+json", ContentType.JSON_PROBLEM),
143
144
  ("text/json", ContentType.JSON_TEXT),
144
145
  ("application/xml", ContentType.XML),
145
146
  ("application/x-www-form-urlencoded", ContentType.FORM),
@@ -148,6 +149,13 @@ media_type_provider = (
148
149
  ("text/html", ContentType.HTML),
149
150
  ("application/pdf", ContentType.PDF),
150
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),
151
159
  ("application/octet-stream", ContentType.BINARY),
152
160
  )
153
161
 
@@ -1,96 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: openapi3-parser
3
- Version: 1.1.14
4
- Summary: OpenAPI v3 parser
5
- Home-page: https://github.com/manchenkoff/openapi3-parser
6
- Author: Artem Manchenkov
7
- Author-email: artem@manchenkoff.me
8
- License: MIT
9
- Project-URL: Source, https://github.com/manchenkoff/openapi3-parser
10
- Keywords: swagger,python,swagger-parser,openapi3-parser,parser,openapi3,swagger-api
11
- Classifier: Development Status :: 4 - Beta
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Operating System :: OS Independent
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Topic :: Software Development :: Libraries
17
- Description-Content-Type: text/markdown
18
- License-File: license.txt
19
- Requires-Dist: prance>=0.20.2
20
- Requires-Dist: openapi-spec-validator==0.6.0
21
-
22
- # OpenAPI Parser
23
-
24
- A simple package to parse your OpenAPI 3 documents into Python object to work with.
25
-
26
- ## How to install
27
-
28
- To install package run the following command
29
-
30
- ```
31
- pip install openapi3-parser
32
- ```
33
-
34
- ## How to use
35
-
36
- Example of parser usage
37
-
38
- ```
39
- >>> from openapi_parser import parse
40
- >>> content = parse('swagger.yml')
41
- >>> print(content)
42
- ```
43
-
44
- Get application servers
45
-
46
- ```python
47
- from openapi_parser import parse
48
-
49
- specification = parse('data/swagger.yml')
50
-
51
- print("Application servers")
52
-
53
- for server in specification.servers:
54
- print(f"{server.description} - {server.url}")
55
-
56
- # Output
57
- #
58
- # >> Application servers
59
- # >> production - https://users.app
60
- # >> staging - http://stage.users.app
61
- # >> development - http://users.local
62
- ```
63
-
64
- Get list of application URLs
65
-
66
- ```python
67
- from openapi_parser import parse
68
-
69
- specification = parse('tests/data/swagger.yml')
70
-
71
- urls = [x.url for x in specification.paths]
72
-
73
- print(urls)
74
-
75
- # Output
76
- #
77
- # >> ['/users', '/users/{uuid}']
78
- ```
79
-
80
- Get operation with supported HTTP methods
81
-
82
- ```python
83
- from openapi_parser import parse
84
-
85
- specification = parse('tests/data/swagger.yml')
86
-
87
- for path in specification.paths:
88
- supported_methods = ','.join([x.method.value for x in path.operations])
89
-
90
- print(f"Operation: {path.url}, methods: {supported_methods}")
91
-
92
- # Output
93
- #
94
- # >> Operation: /users, methods: get,post
95
- # >> Operation: /users/{uuid}, methods: get,put
96
- ```
@@ -1,96 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: openapi3-parser
3
- Version: 1.1.14
4
- Summary: OpenAPI v3 parser
5
- Home-page: https://github.com/manchenkoff/openapi3-parser
6
- Author: Artem Manchenkov
7
- Author-email: artem@manchenkoff.me
8
- License: MIT
9
- Project-URL: Source, https://github.com/manchenkoff/openapi3-parser
10
- Keywords: swagger,python,swagger-parser,openapi3-parser,parser,openapi3,swagger-api
11
- Classifier: Development Status :: 4 - Beta
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Operating System :: OS Independent
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Topic :: Software Development :: Libraries
17
- Description-Content-Type: text/markdown
18
- License-File: license.txt
19
- Requires-Dist: prance>=0.20.2
20
- Requires-Dist: openapi-spec-validator==0.6.0
21
-
22
- # OpenAPI Parser
23
-
24
- A simple package to parse your OpenAPI 3 documents into Python object to work with.
25
-
26
- ## How to install
27
-
28
- To install package run the following command
29
-
30
- ```
31
- pip install openapi3-parser
32
- ```
33
-
34
- ## How to use
35
-
36
- Example of parser usage
37
-
38
- ```
39
- >>> from openapi_parser import parse
40
- >>> content = parse('swagger.yml')
41
- >>> print(content)
42
- ```
43
-
44
- Get application servers
45
-
46
- ```python
47
- from openapi_parser import parse
48
-
49
- specification = parse('data/swagger.yml')
50
-
51
- print("Application servers")
52
-
53
- for server in specification.servers:
54
- print(f"{server.description} - {server.url}")
55
-
56
- # Output
57
- #
58
- # >> Application servers
59
- # >> production - https://users.app
60
- # >> staging - http://stage.users.app
61
- # >> development - http://users.local
62
- ```
63
-
64
- Get list of application URLs
65
-
66
- ```python
67
- from openapi_parser import parse
68
-
69
- specification = parse('tests/data/swagger.yml')
70
-
71
- urls = [x.url for x in specification.paths]
72
-
73
- print(urls)
74
-
75
- # Output
76
- #
77
- # >> ['/users', '/users/{uuid}']
78
- ```
79
-
80
- Get operation with supported HTTP methods
81
-
82
- ```python
83
- from openapi_parser import parse
84
-
85
- specification = parse('tests/data/swagger.yml')
86
-
87
- for path in specification.paths:
88
- supported_methods = ','.join([x.method.value for x in path.operations])
89
-
90
- print(f"Operation: {path.url}, methods: {supported_methods}")
91
-
92
- # Output
93
- #
94
- # >> Operation: /users, methods: get,post
95
- # >> Operation: /users/{uuid}, methods: get,put
96
- ```