Skip to content

Commit 4f4be3c

Browse files
author
Aleksandr Vinogradov
authored
Merge pull request #1 from Scalr/feature/SCALRCORE-19187
SCALRCORE-19187 Add support for 'application/vnd.api+json' content type
2 parents c8a3a98 + a00d7bf commit 4f4be3c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/openApi/v3/parser/getContent.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import type { OpenApiSchema } from '../interfaces/OpenApiSchema';
66
export function getContent(openApi: OpenApi, content: Dictionary<OpenApiMediaType>): OpenApiSchema | null {
77
/* prettier-ignore */
88
return (
9+
content['application/vnd.api+json'] &&
10+
content['application/vnd.api+json'].schema
11+
) || (
912
content['application/json-patch+json'] &&
1013
content['application/json-patch+json'].schema
1114
) || (

src/openApi/v3/parser/getMediaType.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { OpenApiMediaType } from '../interfaces/OpenApiMediaType';
44

55
export function getMediaType(openApi: OpenApi, content: Dictionary<OpenApiMediaType>): string | null {
66
return (
7-
Object.keys(content).find(key => ['application/json-patch+json', 'application/json', 'text/json', 'text/plain', 'multipart/mixed', 'multipart/related', 'multipart/batch'].includes(key)) ||
7+
Object.keys(content).find(key => ['application/vnd.api+json', 'application/json-patch+json', 'application/json', 'text/json', 'text/plain', 'multipart/mixed', 'multipart/related', 'multipart/batch'].includes(key)) ||
88
null
99
);
1010
}

0 commit comments

Comments
 (0)