Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Generic Content Type plugin #3008

wants to merge 2 commits into from

Conversation

mullermp
Copy link
Contributor

Move rest/request plugin to generic. Will add to all services

Copy link

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
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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",
Copy link
Contributor

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?

@mullermp mullermp closed this Apr 15, 2024
@mullermp mullermp deleted the generic-content-type branch April 15, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants