Skip to content

Commit

Permalink
Add supportedMediaTypes needed for kubernetes client
Browse files Browse the repository at this point in the history
  • Loading branch information
dleehr committed Aug 23, 2023
1 parent 6146129 commit 5be6e79
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -24,6 +24,9 @@ let primitives = [

const supportedMediaTypes: { [mediaType: string]: number } = {
"application/json": Infinity,
"application/json-patch+json": 1,
"application/merge-patch+json": 1,
"application/strategic-merge-patch+json": 1,
"application/octet-stream": 0,
"application/x-www-form-urlencoded": 0
}
Expand Down Expand Up @@ -225,7 +228,7 @@ export class ObjectSerializer {
return String(data);
}
if (mediaType === "application/json") {
if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") {
return JSON.stringify(data);
}
Expand All @@ -244,7 +247,7 @@ export class ObjectSerializer {
return rawData;
}
if (mediaType === "application/json") {
if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") {
return JSON.parse(rawData);
}
Expand Down

0 comments on commit 5be6e79

Please sign in to comment.