- 
                Notifications
    
You must be signed in to change notification settings  - Fork 209
 
Closed
Labels
feature-request:sdkSDK specific Feature RequestSDK specific Feature Request
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:
Expected Behavior
When serializing, use the python attribute name if not present in attribute_map.
Current Behavior
If a name of a python attribute is the same as its name in the serialized object, it still needs to be present in the attribute_map.
Possible Solution
// Not required, but suggest a fix/reason for the bug,
// or ideas how to implement the addition or change
I guess it's a one-line change in the Serializer? Sorry, didn't dig into it too much.
Steps to Reproduce (for bugs)
// Provide a self-contained, concise snippet of code
// For more complex issues provide a repo with the smallest sample that reproduces the bug
// Including business logic or unrelated code makes diagnosis more difficult
@attr.s
class Skill:
    launch_count = attr.ib()
    deserialized_type = {'launch_count': 'int'}
    attribute_map = {'launch_count': 'launch_count'} # needless
    # snipContext
I'm using the DefaultSerializer to serialize my models for DynamoDB. It's really cool. I want to suggest of using the python's attribute name as the name of the value in the serialized object if it is not present in the attribute_map mapping. In the example posted above, the attribute_map could be removed altogether, a pattern in a lot of my models. This direct mapping is also quite common in the SDK models, for example here in SimpleCard
Your Environment
- ASK SDK for Python used: 1.5.0
 - Operating System and version: OS X
 
Python version info
- Python version used for development: 3.7
 
Metadata
Metadata
Assignees
Labels
feature-request:sdkSDK specific Feature RequestSDK specific Feature Request