Skip to content

fix: update client error schema to support schema errors (box/box-openapi#467) #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 24, 2024
Merged
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
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "2443714", "specHash": "efab356", "version": "1.7.0" }
{ "engineHash": "2443714", "specHash": "abd6037", "version": "1.7.0" }
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 2 additions & 13 deletions src/schemas/clientError.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ export type ClientErrorCodeField =
| 'item_name_invalid'
| 'insufficient_scope';
export interface ClientErrorContextInfoField {
/**
* More details on the error. */
readonly message?: string;
readonly rawData?: SerializedData;
}
export interface ClientError {
Expand Down Expand Up @@ -135,7 +132,7 @@ export function deserializeClientErrorCodeField(
export function serializeClientErrorContextInfoField(
val: ClientErrorContextInfoField
): SerializedData {
return { ['message']: val.message == void 0 ? void 0 : val.message };
return {};
}
export function deserializeClientErrorContextInfoField(
val: SerializedData
Expand All @@ -145,15 +142,7 @@ export function deserializeClientErrorContextInfoField(
message: 'Expecting a map for "ClientErrorContextInfoField"',
});
}
if (!(val.message == void 0) && !sdIsString(val.message)) {
throw new BoxSdkError({
message:
'Expecting string for "message" of type "ClientErrorContextInfoField"',
});
}
const message: undefined | string =
val.message == void 0 ? void 0 : val.message;
return { message: message } satisfies ClientErrorContextInfoField;
return {} satisfies ClientErrorContextInfoField;
}
export function serializeClientError(val: ClientError): SerializedData {
return {
Expand Down
Loading