@emeryld/rrroutes-client 2.3.6 → 2.3.7

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
@@ -246,6 +246,7 @@ function createRouteClient(opts) {
246
246
  const isGet = leaf.method === "get";
247
247
  const isFeed = !!leaf.cfg.feed;
248
248
  const leafCfg = leaf.cfg;
249
+ const validateResponses = opts.validateResponses ?? true;
249
250
  const method = toUpper(leaf.method);
250
251
  const expectsArgs = Boolean(leafCfg.paramsSchema || leafCfg.querySchema);
251
252
  const leafLabel = `${leaf.method.toUpperCase()} ${String(leaf.path)}`;
@@ -347,24 +348,26 @@ function createRouteClient(opts) {
347
348
  } : void 0
348
349
  )
349
350
  );
350
- const parsed = leafCfg.outputSchema ? (0, import_rrroutes_contract.lowProfileParse)(leafCfg.outputSchema, out) : void 0;
351
- emit(
352
- decorateDebugEvent(
353
- {
354
- type: "fetch",
355
- stage: "parsed",
356
- method,
357
- url,
358
- leaf: leafLabel,
359
- durationMs: Date.now() - startedAt
360
- },
361
- isVerboseDebug ? {
362
- params: normalizedParams,
363
- query: normalizedQuery,
364
- output: parsed
365
- } : void 0
366
- )
367
- );
351
+ const parsed = validateResponses && leafCfg.outputSchema ? (0, import_rrroutes_contract.lowProfileParse)(leafCfg.outputSchema, out) : void 0;
352
+ if (validateResponses) {
353
+ emit(
354
+ decorateDebugEvent(
355
+ {
356
+ type: "fetch",
357
+ stage: "parsed",
358
+ method,
359
+ url,
360
+ leaf: leafLabel,
361
+ durationMs: Date.now() - startedAt
362
+ },
363
+ isVerboseDebug ? {
364
+ params: normalizedParams,
365
+ query: normalizedQuery,
366
+ output: parsed
367
+ } : void 0
368
+ )
369
+ );
370
+ }
368
371
  options?.onReceive?.(parsed);
369
372
  return parsed;
370
373
  } catch (error) {