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 #1

Open
DanRigby opened this issue Jun 6, 2017 · 0 comments
Open

Add Support For Custom Objects and Fields #1

DanRigby opened this issue Jun 6, 2017 · 0 comments

Comments

@DanRigby
Copy link
Owner

DanRigby commented Jun 6, 2017

https://www.jsonfeed.org/version/1.1/:

Publishers can use custom objects in JSON Feeds. Names must start with an _ character followed by a letter. Custom objects can appear anywhere in a feed.

For instance, imagine a podcast directory service — call it Blue Shed Podcasts — that asks a podcaster to specify some additional information about a feed or item. A publisher would do something like this:

"_blue_shed": {
    "about": "https://blueshed-podcasts.com/json-feed-extension-docs",
    "explicit": false,
    "copyright": "1948 by George Orwell",
    "owner": "Big Brother and the Holding Company",
    "subtitle": "All shouting, all the time. Double. Plus. Good."
}

Feed readers that do not understand a given custom object must ignore it.

The about string is there for a human looking at the feed, so they can understand what goes in the custom extension. It's optional, but it should appear at least once in a feed that may contain multiple uses of _blue_shed (preferably in the first use, but that's not required).

Also, it's good practice to name an extension with a company or service name, to provide a clue right away as to what it's for and who made it.

Further naming rules: the extension name and its member keys must not contain any . characters. The extension name, and only the extension name, must begin with an _ character. (No standard keys will ever begin with an _ — this is reserved for extensions.)

Member keys should be alphanumeric. That said, emojis are not illegal — we're not heartless — and somebody's going to use them.

DanRigby added a commit that referenced this issue Oct 16, 2024
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant