raffel 1.1.103 → 1.1.104-next.f933f41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1367,6 +1367,9 @@ function generateExampleFromSchema(schema, refStack = new Set()) {
1367
1367
  return schema.default;
1368
1368
  if (schema.enum && schema.enum.length > 0)
1369
1369
  return schema.enum[0];
1370
+ if (Array.isArray(schema.anyOf) && schema.anyOf.length > 0) {
1371
+ return generateExampleFromSchema(schema.anyOf[0], refStack);
1372
+ }
1370
1373
  switch (schema.type) {
1371
1374
  case 'string': return schema.format === 'email' ? 'user@example.com' : 'string';
1372
1375
  case 'number': return 0;
@@ -1367,6 +1367,9 @@ function generateExampleFromSchema(schema, refStack = new Set()) {
1367
1367
  return schema.default;
1368
1368
  if (schema.enum && schema.enum.length > 0)
1369
1369
  return schema.enum[0];
1370
+ if (Array.isArray(schema.anyOf) && schema.anyOf.length > 0) {
1371
+ return generateExampleFromSchema(schema.anyOf[0], refStack);
1372
+ }
1370
1373
  switch (schema.type) {
1371
1374
  case 'string': return schema.format === 'email' ? 'user@example.com' : 'string';
1372
1375
  case 'number': return 0;