You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For context, my use case is to try and get a smithy-typescript client (in the browser) to talk to a smithy-rs service that are both generated from the same smithy model. I'm almost there, except that I'm running into an issue where the smithy-rs service is rejecting requests from the generated client because it sends an Accept: */* in its request. See smithy-lang/smithy-rs#1544.
Digging into it more, the service side validation comes from this PR here, which cites the smithy protocol tests, and if I'm reading the tests correctly, it seems like it's doing the right thing by requiring Accept: application/json for rest-json or allowing it to be omitted (I think).
There is no reason for a Smithy service to have more strict handling of Accept than the HTTP RFCs describe. */* is a perfectly valid value for this.
edited to add: that being said, the client has knowledge of what the output structure looks like, so if it's a structure and the protocol is restJson1, application/json is a better value for the header.
I suppose there's nothing explicitly called out in those protocol tests for Accept: */* (it's only explicit that you can't send unsupported media types) but it's also not clear what the expected behavior should be if the clients send Accept: */* and gets back something besides application/json or any of the other supported content types in the restJson1 protocol.
For context, my use case is to try and get a smithy-typescript client (in the browser) to talk to a smithy-rs service that are both generated from the same smithy model. I'm almost there, except that I'm running into an issue where the smithy-rs service is rejecting requests from the generated client because it sends an
Accept: */*
in its request. See smithy-lang/smithy-rs#1544.Digging into it more, the service side validation comes from this PR here, which cites the smithy protocol tests, and if I'm reading the tests correctly, it seems like it's doing the right thing by requiring
Accept: application/json
for rest-json or allowing it to be omitted (I think).The headers sent from the generated client are:
Regardless of what end the fix is on, it seems like the smithy-typescript clients should be able to talk to the smithy-rs services.
The text was updated successfully, but these errors were encountered: