Skip to content

Commit 837dccc

Browse files
authored
fix: broken export of entityToJSONSchema (payloadcms#2894)
1 parent 3e05598 commit 837dccc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/utilities/configToJSONSchema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ function fieldsToJSONSchema(collectionIDFieldTypes: { [key: string]: 'string' |
402402
};
403403
}
404404

405-
function entityToJSONSchema(config: SanitizedConfig, incomingEntity: SanitizedCollectionConfig | SanitizedGlobalConfig, interfaceNameDefinitions: Map<string, JSONSchema4>): JSONSchema4 {
405+
// This function is part of the public API and is exported through payload/utilities
406+
export function entityToJSONSchema(config: SanitizedConfig, incomingEntity: SanitizedCollectionConfig | SanitizedGlobalConfig, interfaceNameDefinitions: Map<string, JSONSchema4>): JSONSchema4 {
406407
const entity: SanitizedCollectionConfig | SanitizedGlobalConfig = deepCopyObject(incomingEntity);
407408
const title = entity.typescript?.interface ? entity.typescript.interface : singular(toWords(entity.slug, true));
408409

utilities.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './dist/utilities/configToJSONSchema';
1+
export { entityToJSONSchema } from './dist/utilities/configToJSONSchema';

0 commit comments

Comments
 (0)