Skip to content

Commit

Permalink
fix: Fix type of additionalProperties in metadata query (box/box-open…
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Nov 6, 2024
1 parent 436c732 commit 8bfae89
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "0a79fc3", "specHash": "90cf4e4", "version": "1.7.0" }
{ "engineHash": "0a79fc3", "specHash": "9d452cf", "version": "1.7.0" }
23 changes: 15 additions & 8 deletions src/schemas/metadataQuery.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface MetadataQuery {
* `query`. The type of each parameter used in the `query_params` must match
* the type of the corresponding metadata template field. */
readonly queryParams?: {
readonly [key: string]: string;
readonly [key: string]: any;
};
/**
* The ID of the folder that you are restricting the query to. A
Expand Down Expand Up @@ -145,7 +145,19 @@ export function serializeMetadataQuery(val: MetadataQuery): SerializedData {
return {
['from']: val.from,
['query']: val.query == void 0 ? void 0 : val.query,
['query_params']: val.queryParams == void 0 ? void 0 : val.queryParams,
['query_params']:
val.queryParams == void 0
? void 0
: (Object.fromEntries(
Object.entries(val.queryParams).map(([k, v]: [string, any]) => [
k,
(function (v: any): any {
return v;
})(v),
]),
) as {
readonly [key: string]: any;
}),
['ancestor_folder_id']: val.ancestorFolderId,
['order_by']:
val.orderBy == void 0
Expand Down Expand Up @@ -194,7 +206,7 @@ export function deserializeMetadataQuery(val: SerializedData): MetadataQuery {
const queryParams:
| undefined
| {
readonly [key: string]: string;
readonly [key: string]: any;
} =
val.query_params == void 0
? void 0
Expand All @@ -203,11 +215,6 @@ export function deserializeMetadataQuery(val: SerializedData): MetadataQuery {
Object.entries(val.query_params).map(([k, v]: [string, any]) => [
k,
(function (v: any): any {
if (!sdIsString(v)) {
throw new BoxSdkError({
message: 'Expecting string for "MetadataQuery"',
});
}
return v;
})(v),
]),
Expand Down

0 comments on commit 8bfae89

Please sign in to comment.