-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Generic Content Type plugin #3008
Conversation
You have made a change to core without a corresponding change to the CHANGELOG.md. This change will not result in a new version and will not published unless an entry is added to CHANGELOG.md |
module Aws | ||
module Rest | ||
# NOTE: headers could be already populated if specified on input shape | ||
class ContentTypeHandler < Seahorse::Client::Handler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can remove this. This will break old service w/ new core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: Actually nvm, this isn't dependend on by service clients directly, but through the protocol plugin. So we may be okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It hasn't released yet. This is new code too
# content-type defaults as noted here: | ||
# rest-json: https://smithy.io/2.0/aws/protocols/aws-restxml-protocol.html#content-type | ||
# rest-xml: https://smithy.io/2.0/aws/protocols/aws-restxml-protocol.html#content-type | ||
def apply_default_content_type(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this belongs in Seahorse - this is AWS specific logic per protocol. I'd lean instead towards a generic base class which the protocols can extend and use.
@@ -40,6 +40,7 @@ def compute_plugins(options) | |||
def default_plugins | |||
{ | |||
'Seahorse::Client::Plugins::ContentLength' => "#{seahorse_plugins}/content_length.rb", | |||
'Seahorse::Client::Plugins::ContentType' => "#{seahorse_plugins}/content_type.rb", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this being default, should we relocate the setting of content-type
for other protocols like json here?
Move rest/request plugin to generic. Will add to all services