* Parse data from a string according to the given media type
(rawData: string, mediaType: string | undefined)
| 433 | * Parse data from a string according to the given media type |
| 434 | */ |
| 435 | public static parse(rawData: string, mediaType: string | undefined) { |
| 436 | if (mediaType === undefined) { |
| 437 | throw new Error("Cannot parse content. No Content-Type defined."); |
| 438 | } |
| 439 | |
| 440 | if (mediaType === "application/json") { |
| 441 | return JSON.parse(rawData); |
| 442 | } |
| 443 | |
| 444 | throw new Error("The mediaType " + mediaType + " is not supported by ObjectSerializer.parse."); |
| 445 | } |
| 446 | } |
no outgoing calls
no test coverage detected