forked from MarcoMuellner/openapi-python-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.py
58 lines (46 loc) · 1.21 KB
/
common.py
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from enum import Enum
from typing import Dict
from typing import Optional
from openapi_python_generator.models import LibraryConfig
class HTTPLibrary(str, Enum):
"""
Enum for the available HTTP libraries.
"""
httpx = "httpx"
requests = "requests"
aiohttp = "aiohttp"
class PydanticVersion(str, Enum):
V1 = "v1"
V2 = "v2"
class Formatter(str, Enum):
"""
Enum for the available code formatters.
"""
BLACK = "black"
NONE = "none"
class FormatOptions:
skip_validation: bool = False
line_length: int = 120
library_config_dict: Dict[Optional[HTTPLibrary], LibraryConfig] = {
HTTPLibrary.httpx: LibraryConfig(
name="httpx",
library_name="httpx",
template_name="httpx.jinja2",
include_async=True,
include_sync=True,
),
HTTPLibrary.requests: LibraryConfig(
name="requests",
library_name="requests",
template_name="requests.jinja2",
include_async=False,
include_sync=True,
),
HTTPLibrary.aiohttp: LibraryConfig(
name="aiohttp",
library_name="aiohttp",
template_name="aiohttp.jinja2",
include_async=True,
include_sync=False,
),
}