Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit fce7c04

Browse files
Add support for application/x-pem-file MIME type
This patch adds support for serializing and deserializing data with the application/x-pem-file MIME type as plain text. Fixes: #244
1 parent ec11c61 commit fce7c04

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/main/resources/python/api_client.hbs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,8 @@ class OpenApiResponse(typing.Generic[T], JSONDetector, abc.ABC):
905905
elif content_type.startswith('multipart/form-data'):
906906
body_data = cls.__deserialize_multipart_form_data(response)
907907
content_type = 'multipart/form-data'
908+
elif content_type == 'application/x-pem-file':
909+
body_data = response.data.decode()
908910
else:
909911
raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type))
910912
body_schema = schemas.get_class(body_schema)
@@ -1404,7 +1406,7 @@ class RequestBody(StyleFormSerializer, JSONDetector):
14041406
if isinstance(cast_in_data, (schemas.FileIO, bytes)):
14051407
raise ValueError(f"Invalid input data type. Data must be int/float/str/bool/None/tuple/immutabledict and it was type {type(cast_in_data)}")
14061408
return cls.__serialize_json(cast_in_data)
1407-
elif content_type == 'text/plain':
1409+
elif content_type in ['text/plain', 'application/x-pem-file']:
14081410
if not isinstance(cast_in_data, (int, float, str)):
14091411
raise ValueError(f"Unable to serialize type {type(cast_in_data)} to text/plain")
14101412
return cls.__serialize_text_plain(cast_in_data)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /