Expose OpenAPI helper shouldIgnoreEntity (#2903)

This commit is contained in:
Greg Bergé
2025-02-28 16:22:20 +01:00
committed by GitHub
parent 05affac34f
commit 0924259217
3 changed files with 23 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@gitbook/openapi-parser': patch
---
Expose helper `shouldIgnoreEntity`
@@ -0,0 +1,13 @@
import type { OpenAPIV3 } from '@scalar/openapi-types';
/**
* Check if an entity should be ignored
*/
export function shouldIgnoreEntity(
data:
| undefined
| Pick<OpenAPIV3.TagObject, 'x-internal' | 'x-gitbook-ignore'>
| Pick<OpenAPIV3.OperationObject, 'x-internal' | 'x-gitbook-ignore'>
) {
return data?.['x-internal'] === true || data?.['x-gitbook-ignore'] === true;
}
+5 -4
View File
@@ -1,8 +1,9 @@
export { parseOpenAPI } from './parse';
export type * from '@scalar/openapi-types';
export type * from './types';
export * from './error';
export * from './traverse';
export { dereference } from '@scalar/openapi-parser';
export type { AnyObject } from '@scalar/openapi-parser';
export type * from '@scalar/openapi-types';
export * from './error';
export * from './helpers/shouldIgnoreEntity';
export * from './traverse';
export type * from './types';