Skip to content

Commit

Permalink
fix: update client error schema to support schema errors (box/box-ope…
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Oct 22, 2024
1 parent 1f05906 commit 5d879fe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "2443714", "specHash": "9f75129", "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

0 comments on commit 5d879fe

Please sign in to comment.