@emeryld/rrroutes-client 2.3.7 → 2.3.9

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.
package/dist/index.cjs CHANGED
@@ -348,8 +348,16 @@ function createRouteClient(opts) {
348
348
  } : void 0
349
349
  )
350
350
  );
351
- const parsed = validateResponses && leafCfg.outputSchema ? (0, import_rrroutes_contract.lowProfileParse)(leafCfg.outputSchema, out) : void 0;
352
351
  if (validateResponses) {
352
+ if (!leafCfg.outputSchema) {
353
+ throw new Error(
354
+ `No output schema defined for leaf ${leafLabel}, cannot validate response.`
355
+ );
356
+ }
357
+ out.data = (0, import_rrroutes_contract.lowProfileParse)(
358
+ leafCfg.outputSchema,
359
+ out.data
360
+ );
353
361
  emit(
354
362
  decorateDebugEvent(
355
363
  {
@@ -363,13 +371,13 @@ function createRouteClient(opts) {
363
371
  isVerboseDebug ? {
364
372
  params: normalizedParams,
365
373
  query: normalizedQuery,
366
- output: parsed
374
+ output: out
367
375
  } : void 0
368
376
  )
369
377
  );
370
378
  }
371
- options?.onReceive?.(parsed);
372
- return parsed;
379
+ options?.onReceive?.(out.data);
380
+ return out.data;
373
381
  } catch (error) {
374
382
  emit(
375
383
  decorateDebugEvent(