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

Round trip s3api get/put-bucket-lifecycle #1076

Closed
jamesls opened this issue Dec 30, 2014 · 1 comment · Fixed by boto/botocore#425
Closed

Round trip s3api get/put-bucket-lifecycle #1076

jamesls opened this issue Dec 30, 2014 · 1 comment · Fixed by boto/botocore#425
Labels
bug This issue is a bug.

Comments

@jamesls
Copy link
Member

jamesls commented Dec 30, 2014

An s3api get-bucket-lifecycle response with an xml node prefix of <prefix></prefix> is parsed as None, which shows up in JSON as null:

$ aws s3api get-bucket-lifecycle --bucket bucket
{
    "Rules": [
        {
            "Status": "Enabled",
            "Prefix": null,  # <--- parsed as null

However, if you try to round trip this response with an s3api put-bucket-lifecycle you'll get a validation error as prefix is expected to be a string:

Invalid type for parameter LifecycleConfiguration.Rules[0].Prefix, value: None, type: <type 'NoneType'>, valid types: <type 'basestring'>

Ideally we should parse an xml node that comes across the wire as <foo></foo> as an empty string if the associated output shape is modeled as a string.

We'll need to evaluate that this is not a breaking change, but the consequence of this change is that there may be fields that previously parsed as null will now show up as an empty string.

Filing this issue for now to track progress.

@jamesls
Copy link
Member Author

jamesls commented Jan 7, 2015

Just to follow up here, after discussing this I went ahead and merged the changes. The expected behavior of an empty xml node that's modeled as a string type should default to an empty string instead of null, so this is a bug fix. This also allows for round tripping requests which is a nice side benefit.

kyleknap pushed a commit that referenced this issue Jan 8, 2015
* release-1.7.0:
  Bumping version to 1.7.0
  Update completer test for new services
  Update changelog with new features
  Adding Amazon ECS examples.
  Add #1076 to the changelog
  fix minor typo, ACl -> ACL
  Add EMR fix to latest changes
  Update changelog with botocore fix
  Fix flake8 issues
  Change cwd test to use a tempdir
  Update changelog with latest fix
  Add test to verify no shadowed builtins
  Update changelog
  Update param docs to match actual EC2 docs
thoward-godaddy pushed a commit to thoward-godaddy/aws-cli that referenced this issue Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant