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
3 changes: 2 additions & 1 deletion packages/rtk-query-codegen-openapi/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ export async function generateApi(
name,
originalName: schemaName,
type: getTypeFromSchema(withMode(ctx, 'writeOnly'), schema),
required: true,
// A request body is optional unless the spec explicitly marks it required (OpenAPI defaults `required` to `false`).
required: body.required ?? false,
body,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ export type UploadFileApiArg = {
petId: number;
/** Additional Metadata */
additionalMetadata?: string;
body: Blob;
body?: Blob;
};
export type GetInventoryApiResponse = /** status 200 successful operation */ {
[key: string]: number;
};
export type GetInventoryApiArg = void;
export type PlaceOrderApiResponse = /** status 200 successful operation */ Order;
export type PlaceOrderApiArg = {
order: Order;
order?: Order;
};
export type GetOrderByIdApiResponse = /** status 200 successful operation */ Order;
export type GetOrderByIdApiArg = {
Expand All @@ -170,11 +170,11 @@ export type DeleteOrderApiArg = {
export type CreateUserApiResponse = unknown;
export type CreateUserApiArg = {
/** Created user object */
user: User;
user?: User;
};
export type CreateUsersWithListInputApiResponse = /** status 200 Successful operation */ User;
export type CreateUsersWithListInputApiArg = {
body: User[];
body?: User[];
};
export type LoginUserApiResponse = /** status 200 successful operation */ string;
export type LoginUserApiArg = {
Expand All @@ -195,7 +195,7 @@ export type UpdateUserApiArg = {
/** name that need to be deleted */
username: string;
/** Update an existent user in the store */
user: User;
user?: User;
};
export type DeleteUserApiResponse = unknown;
export type DeleteUserApiArg = {
Expand Down Expand Up @@ -395,15 +395,15 @@ export type UploadFileApiArg = {
petId: number;
/** Additional Metadata */
additionalMetadata?: string;
body: Blob;
body?: Blob;
};
export type GetInventoryApiResponse = /** status 200 successful operation */ {
[key: string]: number;
};
export type GetInventoryApiArg = void;
export type PlaceOrderApiResponse = /** status 200 successful operation */ Order;
export type PlaceOrderApiArg = {
order: Order;
order?: Order;
};
export type GetOrderByIdApiResponse = /** status 200 successful operation */ Order;
export type GetOrderByIdApiArg = {
Expand All @@ -418,11 +418,11 @@ export type DeleteOrderApiArg = {
export type CreateUserApiResponse = unknown;
export type CreateUserApiArg = {
/** Created user object */
user: User;
user?: User;
};
export type CreateUsersWithListInputApiResponse = /** status 200 Successful operation */ User;
export type CreateUsersWithListInputApiArg = {
body: User[];
body?: User[];
};
export type LoginUserApiResponse = /** status 200 successful operation */ string;
export type LoginUserApiArg = {
Expand All @@ -443,7 +443,7 @@ export type UpdateUserApiArg = {
/** name that need to be deleted */
username: string;
/** Update an existent user in the store */
user: User;
user?: User;
};
export type DeleteUserApiResponse = unknown;
export type DeleteUserApiArg = {
Expand Down
Loading
Loading