MCPcopy Create free account
hub / github.com/GitbookIO/gitbook / getSyntaxFromMediaType

Function getSyntaxFromMediaType

packages/react-openapi/src/util/example.tsx:119–133  ·  view source on GitHub ↗

* Get the syntax from a media type.

(mediaType: string)

Source from the content-addressed store, hash-verified

117 * Get the syntax from a media type.
118 */
119function getSyntaxFromMediaType(mediaType: string): string {
120 if (mediaType.includes('json')) {
121 return 'json';
122 }
123
124 if (mediaType.includes('yaml')) {
125 return 'yaml';
126 }
127
128 if (mediaType === 'application/xml') {
129 return 'xml';
130 }
131
132 return 'text';
133}

Callers 1

getExamplesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…