mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 08:05:19 +00:00
Hide x-gitbook-* symbols in OpenAPI blocks (#2863)
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
/**
|
||||
* Stringify an OpenAPI object. Same API as JSON.stringify.
|
||||
*/
|
||||
export function stringifyOpenAPI(body: unknown, transformer?: null, indent?: number): string {
|
||||
return JSON.stringify(body, transformer, indent);
|
||||
export function stringifyOpenAPI(body: unknown, _?: null, indent?: number): string {
|
||||
return JSON.stringify(
|
||||
body,
|
||||
(key, value) => {
|
||||
// Ignore internal keys
|
||||
if (key.startsWith('x-gitbook-')) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return value;
|
||||
},
|
||||
indent,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user