Skip to content

Miscellaneous Pydantic response updates#74

Open
JDCodes wants to merge 10 commits intojasondilworth56:mainfrom
JDCodes:main
Open

Miscellaneous Pydantic response updates#74
JDCodes wants to merge 10 commits intojasondilworth56:mainfrom
JDCodes:main

Conversation

@JDCodes
Copy link

@JDCodes JDCodes commented Jan 15, 2026

added optional None for logo

@jasondilworth56
Copy link
Owner

Thanks for getting to these – with the responses undocumented from iRacing it's very much trial and error to get full coverage.

Could you make sure that you're updating the test files in mock_return_data as well? The way I go about it is:

  • Stumble across a problem, and note the paramaters
  • Call the same endpoint with another instance of the client not using Pydantic
  • Use that output as part of the mock_return_data
  • Check the tests fail in the same way
  • Implement the fix
  • Check the tests now pass

@jasondilworth56 jasondilworth56 changed the title Issue #73 member_profile recent_events.0.logo_url pydantic validation Miscellaneous Pydantic response updates Jan 16, 2026
@jasondilworth56 jasondilworth56 linked an issue Jan 16, 2026 that may be closed by this pull request
@JDCodes
Copy link
Author

JDCodes commented Jan 22, 2026

i have done the testing you mentioned above and added the mock_return_data which caused the fails.
i couldnt find the result with the flair_shortname but its already in class SessionResultDetail(SessionResultDetailBase)

SessionResultDetailDriver(SessionResultDetailBase):
-    flair_shortname: str
+   flair_shortname: str | None = None


class MemberProfileResponse(BaseModel):
activity: MemberActivity
activity: MemberActivity | None = None
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you spotted a member profile in the wild activity of None?

If so, add a new file member_profile_no_activity.json to mock_return_data with that profile and add a test for it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the test and mock_return_data

cust_id: int | None = None
division_name: str | None = None
driver_results: SessionResultDetailDriver | None = None
driver_results: list[SessionResultDetailDriver] | None = None
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could do with a matching file in the mock data and associated test too – I assume these are in team results but I'm not anywhere I can check at the moment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes its a team result, i will add a test too

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the test and mock_return_data

Joachim Doh added 3 commits January 23, 2026 11:47
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.

member_profile recent_events.0.logo_url pydantic validation

2 participants