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

Audit Log Change "type" value can be a string #2110

Closed
zeylahellyer opened this issue Feb 2, 2023 · 0 comments · Fixed by #2111
Closed

Audit Log Change "type" value can be a string #2110

zeylahellyer opened this issue Feb 2, 2023 · 0 comments · Fixed by #2111
Assignees
Labels
c-model Affects the model crate t-bug Programming error in the library

Comments

@zeylahellyer
Copy link
Member

Copied from a report in our Discord server.

Error:

DeserializeBodyError { kind: Deserializing, source: Some(Error("invalid type: string \"discord\", expected u64", line: 1, column: 194)) }

Payload:

{"audit_log_entries": [{"action_type": 80, "changes": [{"key": "type", "new_value": "discord"}, ...], ...}], ...}

Type {
/// New target type.
#[serde(rename = "new_value", skip_serializing_if = "Option::is_none")]
new: Option<u64>,
/// Old target type.
#[serde(rename = "old_value", skip_serializing_if = "Option::is_none")]
old: Option<u64>,

The definition currently assumes an integer because of other entities such as channels and webhooks, but integration types can be strings.

@zeylahellyer zeylahellyer added t-bug Programming error in the library c-model Affects the model crate labels Feb 2, 2023
@zeylahellyer zeylahellyer self-assigned this Feb 2, 2023
zeylahellyer added a commit that referenced this issue Feb 2, 2023
The value of the "type" audit log change may be a string in the case of
integrations or an integer in the case of channels, so we need to change
its values to be an enum with variants for unsigned integers and string.

Closes #2110.
zeylahellyer added a commit that referenced this issue Feb 2, 2023
The value of the "type" audit log change may be a string in the case of
integrations or an integer in the case of channels, so we need to change
its values to be an enum with variants for unsigned integers and string.

Closes #2110.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-model Affects the model crate t-bug Programming error in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant