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

Add support for custom objects and fields #94

Closed
wants to merge 1 commit into from

Conversation

DanRigby
Copy link
Owner

@DanRigby DanRigby commented Oct 16, 2024

Fixes #1

Add support for custom objects and fields in JSON feeds.

  • Add CustomObjects property to JsonFeed and JsonFeedItem classes to store custom objects.
  • Update Simple.json test resource to include examples of custom objects with names starting with an underscore and alphanumeric member keys.
  • Add test in JsonFeedTests.cs to verify the handling of custom objects in the feed.

For more details, open the Copilot Workspace session.

Fixes #1

Add support for custom objects and fields in JSON feed.

* Add `CustomObjects` property to `JsonFeed` and `JsonFeedItem` classes to store custom objects.
* Update `Simple.json` test resource to include examples of custom objects with names starting with an underscore and alphanumeric member keys.
* Add test in `JsonFeedTests.cs` to verify the handling of custom objects in the feed.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/DanRigby/JsonFeed.NET/issues/1?shareId=XXXX-XXXX-XXXX-XXXX).
@DanRigby DanRigby marked this pull request as draft October 16, 2024 15:55
@DanRigby
Copy link
Owner Author

Not bad 🤖, not bad.
Marking as draft as there's some things I want to adjust before merging.

@DanRigby
Copy link
Owner Author

Played around with this for a bit. The CustomObject signature needs to actually be Dictionary<string, object> to allow us to both serialize and deserialize easily.

Unfortunately, with source generation enabled, we need to know our types and provide the JsonTypeInfo when serializing and deserializing. I'm at a bit of an impasse on the best way to handle that, so I'm going close this PR for now.

@DanRigby DanRigby closed this Oct 17, 2024
@DanRigby DanRigby deleted the add-custom-objects branch October 17, 2024 16:59
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.

Add Support For Custom Objects and Fields
1 participant