FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
openapi-python-client/openapi_python_client/parser/errors.py at main · ramnes/openapi-python-client · GitHub
ramnes
openapi-python-client
Repository navigation
Code
Pull requests
10
(10)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
openapi-python-client
/
openapi_python_client
/
parser
/
errors.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (27 loc) · 1.08 KB
Breadcrumbs
openapi-python-client
/
openapi_python_client
/
parser
/
errors.py
Copy path
File metadata and controls
43 lines (27 loc) · 1.08 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from
dataclasses
import
dataclass
from
enum
import
Enum
from
typing
import
Optional
__all__
=
[
"GeneratorError"
,
"ParseError"
,
"PropertyError"
,
"ValidationError"
]
from
pydantic
import
BaseModel
class
ErrorLevel
(
Enum
):
""" The level of an error """
WARNING
=
"WARNING"
# Client is still generated but missing some pieces
ERROR
=
"ERROR"
# Client could not be generated
@
dataclass
class
GeneratorError
:
""" Base data struct containing info on an error that occurred """
detail
:
Optional
[
str
]
=
None
level
:
ErrorLevel
=
ErrorLevel
.
ERROR
header
:
str
=
"Unable to generate the client"
@
dataclass
class
ParseError
(
GeneratorError
):
""" An error raised when there's a problem parsing an OpenAPI document """
level
:
ErrorLevel
=
ErrorLevel
.
WARNING
data
:
Optional
[
BaseModel
]
=
None
header
:
str
=
"Unable to parse this part of your OpenAPI document: "
@
dataclass
class
PropertyError
(
ParseError
):
""" Error raised when there's a problem creating a Property """
header
=
"Problem creating a Property: "
class
ValidationError
(
Exception
):
pass
Back
|
FazBrowse Home
|
New Git URL