-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for custom objects and fields
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).
- Loading branch information
Showing
4 changed files
with
54 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
{ | ||
"version": "https://jsonfeed.org/version/1", | ||
"title": "My Example Feed", | ||
"home_page_url": "https://example.org/", | ||
"feed_url": "https://example.org/feed.json", | ||
"items": [ | ||
{ | ||
"id": "2", | ||
"url": "https://example.org/second-item", | ||
"content_text": "This is a second item." | ||
}, | ||
{ | ||
"id": "1", | ||
"url": "https://example.org/initial-post", | ||
"content_html": "<p>Hello, world!</p>" | ||
} | ||
] | ||
} | ||
{ | ||
"version": "https://jsonfeed.org/version/1", | ||
"title": "My Example Feed", | ||
"home_page_url": "https://example.org/", | ||
"feed_url": "https://example.org/feed.json", | ||
"items": [ | ||
{ | ||
"id": "2", | ||
"url": "https://example.org/second-item", | ||
"content_text": "This is a second item.", | ||
"_custom_object": { | ||
"custom_key1": "custom_value1", | ||
"custom_key2": "custom_value2" | ||
} | ||
}, | ||
{ | ||
"id": "1", | ||
"url": "https://example.org/initial-post", | ||
"content_html": "<p>Hello, world!</p>" | ||
} | ||
], | ||
"_custom_feed_object": { | ||
"custom_feed_key1": "custom_feed_value1", | ||
"custom_feed_key2": "custom_feed_value2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters