Skip to content

Add id_str and owner_id_str to webhook Event, ignore undeclared properties - #116

Open
rvd-kentaa wants to merge 1 commit into
dblock:masterfrom
rvd-kentaa:add-id-str
Open

rvd-kentaa wants to merge 1 commit into
dblock:masterfrom
rvd-kentaa:add-id-str

Conversation

@rvd-kentaa

Copy link
Copy Markdown

Strava webhook events can include id_str, the string version of id. Strava::Webhooks::Models::Event doesn't declare this. Because it's a plain Hashie::Trash without IgnoreUndeclared, any field it doesn't declare raises NoMethodError when an event is parsed.

This PR:

  • Adds id_str (mapped from object_id_str) and owner_id_str to Strava::Webhooks::Models::Event.
  • Includes Hashie::Extensions::IgnoreUndeclared in Event, so new fields Strava adds later don't break parsing. This matches how Strava::Model already handles API responses.
  • Adds specs for the new properties and for ignoring unknown properties.

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.

1 participant