type GenerateSampleOptions = Partial<{ mode: 'read' | 'write'; spec: object; }>; /** * Generates a sample JSON value from a JSON Schema using openapi-sampler. * * @param schema - A JSON Schema object to generate a sample from. * Must be a plain JavaScript object (not null, array, or primitive). * * @param options - Optional configuration for sample generation. * - `mode`: Filter properties by read/write semantics (`'read'` | `'write'`). * - `spec`: Full OpenAPI specification, required if schema contains `$ref` references. * * @returns An object containing either the generated value or an error message. * - `value`: The generated sample (object or array), or `null` if generation failed. * - `error`: A descriptive error message if generation failed, or `null` on success. * * @example * // Basic object schema * generateSampleFromSchema({ * type: 'object', * properties: { name: { type: 'string' } } * }); * // Returns: { value: { name: 'string' }, error: null } * * @example * // Using read mode to exclude writeOnly properties * generateSampleFromSchema( * { * type: 'object', * properties: { * id: { type: 'integer', readOnly: true }, * password: { type: 'string', writeOnly: true } * } * }, * { mode: 'read' } * ); * // Returns: { value: { id: 0 }, error: null } * * @example * // Schema with $ref requires spec * generateSampleFromSchema( * { $ref: '#/components/schemas/User' }, * { spec: openApiDocument } * ); * * @example * // Empty schema returns error * generateSampleFromSchema({ type: 'object' }); * // Returns: { value: null, error: 'Invalid JSON Schema: schema must include properties, items, allOf/anyOf/oneOf, or example/enum/const/default' } * * @remarks * - Primitive schemas (`type: 'string'`, `type: 'integer'`, etc.) are not supported. * - See `../__tests__/generate-sample-from-schema.test.ts` for comprehensive usage examples. */ export declare function generateSampleFromSchema(schema: unknown, options?: GenerateSampleOptions): { value: unknown; error: string | null; }; export {}; //# sourceMappingURL=generate-sample-from-schema.d.ts.map