File: __init__.py

package info (click to toggle)
python-openapi-core 0.19.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 2,008 kB
  • sloc: python: 18,868; makefile: 47
file content (43 lines) | stat: -rw-r--r-- 1,355 bytes parent folder | download
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
"""OpenAPI core unmarshalling request module"""

from typing import Mapping

from openapi_spec_validator.versions import consts as versions
from openapi_spec_validator.versions.datatypes import SpecVersion

from openapi_core.unmarshalling.request.types import RequestUnmarshallerType
from openapi_core.unmarshalling.request.types import (
    WebhookRequestUnmarshallerType,
)
from openapi_core.unmarshalling.request.unmarshallers import (
    V30RequestUnmarshaller,
)
from openapi_core.unmarshalling.request.unmarshallers import (
    V31RequestUnmarshaller,
)
from openapi_core.unmarshalling.request.unmarshallers import (
    V31WebhookRequestUnmarshaller,
)

__all__ = [
    "UNMARSHALLERS",
    "WEBHOOK_UNMARSHALLERS",
    "V3RequestUnmarshaller",
    "V3WebhookRequestUnmarshaller",
    "V30RequestUnmarshaller",
    "V31RequestUnmarshaller",
    "V31WebhookRequestUnmarshaller",
]

# versions mapping
UNMARSHALLERS: Mapping[SpecVersion, RequestUnmarshallerType] = {
    versions.OPENAPIV30: V30RequestUnmarshaller,
    versions.OPENAPIV31: V31RequestUnmarshaller,
}
WEBHOOK_UNMARSHALLERS: Mapping[SpecVersion, WebhookRequestUnmarshallerType] = {
    versions.OPENAPIV31: V31WebhookRequestUnmarshaller,
}

# alias to the latest v3 version
V3RequestUnmarshaller = V31RequestUnmarshaller
V3WebhookRequestUnmarshaller = V31WebhookRequestUnmarshaller