from-schema
Version:
Infer TypeScript types from JSON schemas
15 lines (13 loc) • 585 B
TypeScript
import { SchemaBase } from '../generic/SchemaBase';
export type ObjectBsonSchemaWithoutRequired = SchemaBase & {
readonly bsonType: 'object';
readonly properties: Record<string, any>;
readonly minProperties?: number;
readonly maxProperties?: number;
readonly examples?: Record<string, any>[];
readonly additionalProperties?: false | any;
};
export type ObjectBsonSchemaWithRequired = ObjectBsonSchemaWithoutRequired & {
readonly required: readonly string[];
};
export type ObjectBsonSchema = ObjectBsonSchemaWithoutRequired | ObjectBsonSchemaWithRequired;