Skip to content

Commit 54b3988

Browse files
fixed a bug where swagger contentTypes could include charsets data
1 parent 944ee36 commit 54b3988

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/serializers/swagger/v2.0/Serializer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1479,11 +1479,11 @@ methods.isProducesHeader = (param) => {
14791479
methods.extractContentTypesFromParam = (param) => {
14801480
const schema = param.getJSONSchema(false)
14811481
if (schema.enum) {
1482-
return schema.enum
1482+
return schema.enum.map(contentType => contentType.split(';')[0])
14831483
}
14841484

14851485
if (schema.default) {
1486-
return [ schema.default ]
1486+
return [ schema.default ].map(contentType => contentType.split(';')[0])
14871487
}
14881488

14891489
return []

0 commit comments

Comments
 (0)