Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Conversation

@whitdog47
Copy link
Contributor

@whitdog47 whitdog47 commented May 22, 2025

This PR adds a Pydantic field serializer for the href attribute on the Link model so that URLs are rendered as strings when serializing.

@whitdog47 whitdog47 requested review from Copilot and kevgliss May 22, 2025 23:44
@whitdog47 whitdog47 self-assigned this May 22, 2025
@whitdog47 whitdog47 added the bug Something isn't working label May 22, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a Pydantic field serializer for the href attribute on the Link model so that URLs are rendered as strings when serializing.

  • Imported field_serializer from Pydantic.
  • Defined serialize_href on Link to convert AnyHttpUrl to str.
Comments suppressed due to low confidence (1)

src/dispatch/data/source/models.py:110

  • Add a unit test to verify that serializing a Link instance correctly converts href to a string in the output JSON.
@field_serializer("href")

@whitdog47 whitdog47 merged commit e944912 into main May 27, 2025
9 checks passed
@whitdog47 whitdog47 deleted the fix/add-serializer-for-href branch May 27, 2025 18:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants