-
Notifications
You must be signed in to change notification settings - Fork 656
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
Type generation creates UseridMap as an interface when it is a Map/Record/object #1584
Comments
Hi @rockingskier, thanks for taking the time to report this! I agree that this should be improved in future versions |
I've been having a dig around... This is the Java class: https://github.com/slackapi/java-slack-sdk/blob/main/slack-api-client/src/main/java/com/slack/api/methods/response/migration/MigrationExchangeResponse.java#L37 The generator uses
I dropped the example JSON into https://app.quicktype.io/ and had a quick go and tricking |
I haven't checked in detail yet, but the approach I took for the "shares" property may work for this too:
|
When generating types for
packages/web-api/src/response/MigrationExchangeResponse.ts
,UseridMap
is created as aninterface
when really it should be aRecord
.This means when calling
migration.exchange
the data inresponse.user_id_map
needs to be cast before it can used.Packages:
Select all that apply:
@slack/web-api
@slack/rtm-api
@slack/webhooks
@slack/oauth
@slack/socket-mode
@slack/types
Reproducible in:
Whatever is in main at the moment: 57dfdda
Steps to reproduce:
./generate-web-api-types.sh
Expected result:
Actual result:
The text was updated successfully, but these errors were encountered: