@hey-api/openapi-ts 0.80.15 → 0.80.16

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.
@@ -65,7 +65,11 @@ export const createClient = (config: Config = {}): Client => {
65
65
  }
66
66
 
67
67
  if (requestValidator) {
68
- await requestValidator(options);
68
+ await requestValidator({
69
+ ...options,
70
+ // @ts-expect-error
71
+ body: options.rawBody,
72
+ });
69
73
  }
70
74
  },
71
75
  ...opts.onRequest,
@@ -107,6 +111,7 @@ export const createClient = (config: Config = {}): Client => {
107
111
  }
108
112
 
109
113
  if (composable === 'useFetch' || composable === 'useLazyFetch') {
114
+ opts.rawBody = opts.body;
110
115
  const bodyParams = reactive({
111
116
  body: opts.body,
112
117
  bodySerializer: opts.bodySerializer,
@@ -72,6 +72,7 @@ export interface RequestOptions<
72
72
  body?: unknown;
73
73
  path?: FetchOptions<unknown>['query'];
74
74
  query?: FetchOptions<unknown>['query'];
75
+ rawBody?: unknown;
75
76
  }> {
76
77
  asyncDataOptions?: AsyncDataOptions<ResT, ResT, KeysOf<ResT>, DefaultT>;
77
78
  composable: TComposable;
@@ -369,6 +369,7 @@ export const executeFetchFn = (
369
369
  fetchFn: Required<Config>['$fetch'],
370
370
  ) => {
371
371
  const unwrappedOpts = unwrapRefs(opts);
372
+ unwrappedOpts.rawBody = unwrappedOpts.body;
372
373
  unwrappedOpts.body = serializeBody(unwrappedOpts);
373
374
  return fetchFn(
374
375
  buildUrl(opts),