Skip to content
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 esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ esbuild
},
},
],
})
})
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"typescript": "^5.3.2"
},
"dependencies": {
"@dylibso/xtp-bindgen": "1.0.0-rc.13",
"@dylibso/xtp-bindgen": "1.0.0-rc.16",
"ejs": "^3.1.10"
}
}
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function toRustTypeX(type: XtpNormalizedType): string {
return optionalize('String')
case 'int32':
return optionalize('i32')
case 'int64':
return optionalize('i64')
Comment on lines +33 to +34
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

went ahead and added this while here

case 'float':
return optionalize('f32')
case 'double':
Expand Down Expand Up @@ -59,7 +61,7 @@ function toRustTypeX(type: XtpNormalizedType): string {
const { keyType, valueType } = type as MapType
return optionalize(`serde_json::Map<${toRustTypeX(keyType)}, ${toRustTypeX(valueType)}>`)
default:
throw new Error(`Can't convert XTP type to Rust type: "${type}"`)
throw new Error(`Can't convert XTP type to Rust type: "${JSON.stringify(type)}"`)
}
}

Expand Down
1 change: 0 additions & 1 deletion tests/schemas/random.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ imports:
contentType: application/json
description: Nested reference input
output:
type: object
contentType: application/json
description: Nested output structure
"$ref": "#/components/schemas/NestedObject"
Expand Down
Loading