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

On the generated model for message the from attribute is named from_ (with a trailing underscore) #923

Closed
JayChase opened this issue Oct 9, 2024 · 1 comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@JayChase
Copy link

JayChase commented Oct 9, 2024

Describe the bug

The message the from attribute is named from_ (with a trailing underscore). As this is generated code I guess I can't just change it and raise a PR?

from_: Optional[Recipient] = None

Expected behavior

The json for Message will have the property named as from

How to reproduce

To see how this causes an issue create an instance of Message with message json

{
    "subject": "test subject",
    "body": {
        "contentType": "html",
        "content": "test content"
    },
    "from": {
        "additionalData": {},
        "backingStore": {
        "initializationCompleted": true,
        "returnOnlyChangedValues": false
        },
        "emailAddress": {
        "additionalData": {},
        "address": "test@gmail.com",
        "backingStore": {
            "initializationCompleted": true,
            "returnOnlyChangedValues": false
        },
        "name": "Test User",
        "odataType": null
        },
        "odataType": null
    }
}
data = json.loads(good_json_data)
snake_case_data = humps.decamelize(json_data)
message = Message(**snake_case_data)

error

TypeError: Message.__init__() got an unexpected keyword argument 'from'

SDK Version

1.9.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@JayChase JayChase added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Oct 9, 2024
@JayChase
Copy link
Author

JayChase commented Oct 9, 2024

Closing this as I just realized why 🤭

@JayChase JayChase closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

1 participant