diff --git a/src/openapi_parser/enumeration.py b/src/openapi_parser/enumeration.py index d444e12..2660516 100644 --- a/src/openapi_parser/enumeration.py +++ b/src/openapi_parser/enumeration.py @@ -97,6 +97,8 @@ class CookieParameterStyle(Enum): @unique class ContentType(Enum): JSON = 'application/json' + JSON_TEXT = 'text/json' + JSON_ANY = 'application/*+json' XML = 'application/xml' FORM = 'application/x-www-form-urlencoded' MULTIPART_FORM = 'multipart/form-data' diff --git a/tests/builders/test_content_builder.py b/tests/builders/test_content_builder.py index 7043674..58b0f46 100644 --- a/tests/builders/test_content_builder.py +++ b/tests/builders/test_content_builder.py @@ -31,6 +31,19 @@ def _get_schema_factory_mock(expected_value: Schema) -> SchemaFactory: ], _get_schema_factory_mock(string_schema) ), + ( + { + "text/json": { + "schema": { + "type": "string" + } + } + }, + [ + Content(type=ContentType.JSON_TEXT, schema=string_schema) + ], + _get_schema_factory_mock(string_schema) + ), ) diff --git a/tests/test_enumeration.py b/tests/test_enumeration.py index b4ae5b4..ebf1f8c 100644 --- a/tests/test_enumeration.py +++ b/tests/test_enumeration.py @@ -139,6 +139,8 @@ def test_parameter_location_error() -> None: media_type_provider = ( ("application/json", ContentType.JSON), + ("application/*+json", ContentType.JSON_ANY), + ("text/json", ContentType.JSON_TEXT), ("application/xml", ContentType.XML), ("application/x-www-form-urlencoded", ContentType.FORM), ("multipart/form-data", ContentType.MULTIPART_FORM),