Skip to content
Prev Previous commit
Next Next commit
Makes MediaType.schema optional
  • Loading branch information
spacether committed Apr 13, 2022
commit 8a18944d5e03319e8cca5ab3ec8452e20cbe1e3b
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ class Encoding:
self.allow_reserved = allow_reserved


@dataclass
class MediaType:
"""
Used to store request and response body schema information
Expand All @@ -682,14 +683,8 @@ class MediaType:
The encoding object SHALL only apply to requestBody objects when the media type is
multipart or application/x-www-form-urlencoded.
"""

def __init__(
self,
schema: typing.Type[Schema],
encoding: typing.Optional[typing.Dict[str, Encoding]] = None,
):
self.schema = schema
self.encoding = encoding
schema: typing.Optional[typing.Type[Schema]] = None
encoding: typing.Optional[typing.Dict[str, Encoding]] = None


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ def __init__(
self.allow_reserved = allow_reserved


@dataclass
class MediaType:
"""
Used to store request and response body schema information
Expand All @@ -687,14 +688,8 @@ class MediaType:
The encoding object SHALL only apply to requestBody objects when the media type is
multipart or application/x-www-form-urlencoded.
"""

def __init__(
self,
schema: typing.Type[Schema],
encoding: typing.Optional[typing.Dict[str, Encoding]] = None,
):
self.schema = schema
self.encoding = encoding
schema: typing.Optional[typing.Type[Schema]] = None
encoding: typing.Optional[typing.Dict[str, Encoding]] = None


@dataclass
Expand Down