Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/openapi-ts-axios/src/client/client/client.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.body = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

const url = buildUrl(opts);

try {
Expand Down
8 changes: 4 additions & 4 deletions examples/openapi-ts-fetch/src/client/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.body = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.body === undefined || opts.body === '') {
opts.headers.delete('Content-Type');
Expand Down
8 changes: 4 additions & 4 deletions examples/openapi-ts-openai/src/client/client/client.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
8 changes: 4 additions & 4 deletions examples/openapi-ts-sample/src/client/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.body = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.body === undefined || opts.body === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
8 changes: 4 additions & 4 deletions packages/custom-client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.body = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.body === undefined || opts.body === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.serializedBody = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

// remove Content-Type header if body is empty to avoid sending invalid requests
if (opts.serializedBody === undefined || opts.serializedBody === '') {
opts.headers.delete('Content-Type');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ export const createClient = (config: Config = {}): Client => {
});
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

if (opts.body && opts.bodySerializer) {
opts.body = opts.bodySerializer(opts.body);
}

if (opts.requestValidator) {
await opts.requestValidator(opts);
}

const url = buildUrl(opts);

return { opts, url };
Expand Down
Loading
Loading