From 362490dcf1b3c13caeaeb045ceb9e1b60ba9b727 Mon Sep 17 00:00:00 2001 From: Dan Rigby <114417+DanRigby@users.noreply.github.com> Date: Thu, 13 Jul 2023 20:23:25 -0400 Subject: [PATCH 1/2] Fix Code analysis issues --- JsonFeedNet.Tests/JsonFeedTests.cs | 6 +- JsonFeedNet.Tests/TestExtensions.cs | 4 +- JsonFeedNet/JsonFeed.cs | 340 ++++++++++++++-------------- JsonFeedNet/JsonFeedAttachment.cs | 65 +++--- JsonFeedNet/JsonFeedAuthor.cs | 47 ++-- JsonFeedNet/JsonFeedHub.cs | 29 ++- JsonFeedNet/JsonFeedItem.cs | 236 ++++++++++--------- 7 files changed, 354 insertions(+), 373 deletions(-) diff --git a/JsonFeedNet.Tests/JsonFeedTests.cs b/JsonFeedNet.Tests/JsonFeedTests.cs index 2cee7e2..fbd7a36 100644 --- a/JsonFeedNet.Tests/JsonFeedTests.cs +++ b/JsonFeedNet.Tests/JsonFeedTests.cs @@ -1,10 +1,8 @@ -// ReSharper disable StringLiteralTypo +namespace JsonFeedNet.Tests; using JustEat.HttpClientInterception; using Xunit; -namespace JsonFeedNet.Tests; - public class JsonFeedTests { [Fact] @@ -126,7 +124,7 @@ public void WriteFeedToString() new() { Name = "Dan Rigby", - Url = "https://twitter.com/DanRigby", + Url = "https://twitter.com/DanRigby" } }, Items = new List diff --git a/JsonFeedNet.Tests/TestExtensions.cs b/JsonFeedNet.Tests/TestExtensions.cs index 3616442..ddeaf64 100644 --- a/JsonFeedNet.Tests/TestExtensions.cs +++ b/JsonFeedNet.Tests/TestExtensions.cs @@ -1,6 +1,6 @@ -using System.Reflection; +namespace JsonFeedNet.Tests; -namespace JsonFeedNet.Tests; +using System.Reflection; public static class TestExtensions { diff --git a/JsonFeedNet/JsonFeed.cs b/JsonFeedNet/JsonFeed.cs index ae1c76f..88c99ab 100644 --- a/JsonFeedNet/JsonFeed.cs +++ b/JsonFeedNet/JsonFeed.cs @@ -1,181 +1,175 @@ -// ReSharper disable UnusedAutoPropertyAccessor.Global -// ReSharper disable CollectionNeverUpdated.Global -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable UnusedMember.Global +namespace JsonFeedNet using System.Text; using Newtonsoft.Json; -namespace JsonFeedNet +public class JsonFeed { - public class JsonFeed + private static readonly JsonSerializerSettings s_serializerSettings = new() { - private static readonly JsonSerializerSettings s_serializerSettings = new() - { - Formatting = Formatting.Indented, - NullValueHandling = NullValueHandling.Ignore, - DateFormatHandling = DateFormatHandling.IsoDateFormat - }; - - /// - /// The URL of the version of the format the feed uses. - /// - [JsonProperty("version")] - public string Version { get; set; } = "https://jsonfeed.org/version/1.1"; //required - - /// - /// The name of the feed. - /// This will often correspond to the name of the website(blog, for instance). - /// - [JsonProperty("title")] - public string Title { get; set; } //required - - /// - /// The URL of the resource that the feed describes. - /// This resource may or may not actually be a “home” page, but it should be an HTML page. - /// - [JsonProperty("home_page_url")] - public string HomePageUrl { get; set; } //optional - - /// - /// The URL of the feed. - /// Serves as the unique identifier for the feed. - /// - [JsonProperty("feed_url")] - public string FeedUrl { get; set; } //optional - - /// - /// More detail, beyond the title, on what the feed is about. - /// A feed reader may display this text. - /// - [JsonProperty("description")] - public string Description { get; set; } //optional - - /// - /// Description of the purpose of the feed. - /// This is for the use of people looking at the raw JSON, and should be ignored by feed readers. - /// - [JsonProperty("user_comment")] - public string UserComment { get; set; } //optional - - /// - /// The URL of a feed that provides the next n items, where n is determined by the publisher. - /// This allows for pagination, but with the expectation that reader software is not required to use it and probably - /// won’t use it very often. - /// Must not be the same as FeedUrl, and it must not be the same as a previous NextUrl (to avoid infinite loops). - /// - [JsonProperty("next_url")] - public string NextUrl { get; set; } //optional - - /// - /// The URL of an image for the feed suitable to be used in a timeline, much the way an avatar might be used. - /// It should be square and relatively large — such as 512 x 512 — so that it can be scaled-down. - /// It should use transparency where appropriate, since it may be rendered on a non-white background. - /// - [JsonProperty("icon")] - public string Icon { get; set; } //optional - - /// - /// The URL of an image for the feed suitable to be used in a source list. - /// It should be square and relatively small, but not smaller than 64 x 64. - /// It should use transparency where appropriate, since it may be rendered on a non-white background. - /// - [JsonProperty("favicon")] - public string FavIcon { get; set; } //optional - - /// - /// The feed author. - /// - [JsonProperty("author")] - [Obsolete("obsolete by specification version 1.1. Use `Authors`")] - public JsonFeedAuthor Author { get; set; } //optional - - /// - /// Specifies one or more feed authors. - /// - [JsonProperty("authors")] - public List Authors { get; set; } //optional - - /// - /// Primary language for the feed in the format specified in RFC 5646. - /// The value is usually a 2-letter language tag from ISO 639-1, optionally followed by a region tag. - /// (Examples: en or en-US.) - /// - [JsonProperty("language")] - public string Language { get; set; } //optional - - /// - /// Indicates whether or not the feed is finished — that is, whether or not it will ever update again. - /// If the value is true, then it’s expired. Any other value, or the absence of expired, means the feed may continue to - /// update. - /// - [JsonProperty("expired")] - public bool? Expired { get; set; } //optional - - /// - /// Endpoints that can be used to subscribe to real-time notifications of changes to this feed. - /// - [JsonProperty("hubs")] - public List Hubs { get; set; } //optional - - /// - /// The individual items in the feed. - /// - [JsonProperty("items")] - public List Items { get; set; } //required - - /// - /// Parses a JsonFeed in an input string into a JsonFeed object for use by code. - /// - /// The JSON Feed as a string. - /// A JsonFeed object representing the parsed feed. - public static JsonFeed Parse(string jsonFeedString) - { - return JsonConvert.DeserializeObject(jsonFeedString); - } - - /// - /// Retrieves a remote feed from the specified Uri and parses it into a JsonFeed object for use by code. - /// - /// The Uri of the JSON Feed to retrieve and parse. - /// Optional: A customer HttpMessageHandler implementation to use for the network requests(s). - /// A JsonFeed object representing the parsed feed. - public static async Task ParseFromUriAsync(Uri jsonFeedUri, HttpMessageHandler httpMessageHandler = null) - { - HttpClient client = new(httpMessageHandler ?? new HttpClientHandler()); - string jsonDocument = await client.GetStringAsync(jsonFeedUri); - - return Parse(jsonDocument); - } - - /// - /// Serializes the JsonFeed object into a JSON string. - /// - /// A string containing the generated feed JSON. - public string Write() - { - return ToString(); - } - - /// - /// Serializes the JsonFeed object into a JSON string and writes it to the provided stream. - /// - /// The stream to write the JSON to. - public void Write(Stream stream) - { - var encoding = new UTF8Encoding(false); - var writer = new StreamWriter(stream, encoding); - writer.Write(this); - writer.Flush(); - } - - /// - /// Serializes the JsonFeed object into a JSON string. - /// - /// A string containing the generated feed JSON. - public override string ToString() - { - return JsonConvert.SerializeObject(this, s_serializerSettings); - } + Formatting = Formatting.Indented, + NullValueHandling = NullValueHandling.Ignore, + DateFormatHandling = DateFormatHandling.IsoDateFormat + }; + + /// + /// The URL of the version of the format the feed uses. + /// + [JsonProperty("version")] + public string Version { get; set; } = "https://jsonfeed.org/version/1.1"; //required + + /// + /// The name of the feed. + /// This will often correspond to the name of the website(blog, for instance). + /// + [JsonProperty("title")] + public string Title { get; set; } //required + + /// + /// The URL of the resource that the feed describes. + /// This resource may or may not actually be a “home” page, but it should be an HTML page. + /// + [JsonProperty("home_page_url")] + public string HomePageUrl { get; set; } //optional + + /// + /// The URL of the feed. + /// Serves as the unique identifier for the feed. + /// + [JsonProperty("feed_url")] + public string FeedUrl { get; set; } //optional + + /// + /// More detail, beyond the title, on what the feed is about. + /// A feed reader may display this text. + /// + [JsonProperty("description")] + public string Description { get; set; } //optional + + /// + /// Description of the purpose of the feed. + /// This is for the use of people looking at the raw JSON, and should be ignored by feed readers. + /// + [JsonProperty("user_comment")] + public string UserComment { get; set; } //optional + + /// + /// The URL of a feed that provides the next n items, where n is determined by the publisher. + /// This allows for pagination, but with the expectation that reader software is not required to use it and probably + /// won’t use it very often. + /// Must not be the same as FeedUrl, and it must not be the same as a previous NextUrl (to avoid infinite loops). + /// + [JsonProperty("next_url")] + public string NextUrl { get; set; } //optional + + /// + /// The URL of an image for the feed suitable to be used in a timeline, much the way an avatar might be used. + /// It should be square and relatively large — such as 512 x 512 — so that it can be scaled-down. + /// It should use transparency where appropriate, since it may be rendered on a non-white background. + /// + [JsonProperty("icon")] + public string Icon { get; set; } //optional + + /// + /// The URL of an image for the feed suitable to be used in a source list. + /// It should be square and relatively small, but not smaller than 64 x 64. + /// It should use transparency where appropriate, since it may be rendered on a non-white background. + /// + [JsonProperty("favicon")] + public string FavIcon { get; set; } //optional + + /// + /// The feed author. + /// + [JsonProperty("author")] + [Obsolete("obsolete by specification version 1.1. Use `Authors`")] + public JsonFeedAuthor Author { get; set; } //optional + + /// + /// Specifies one or more feed authors. + /// + [JsonProperty("authors")] + public List Authors { get; set; } //optional + + /// + /// Primary language for the feed in the format specified in RFC 5646. + /// The value is usually a 2-letter language tag from ISO 639-1, optionally followed by a region tag. + /// (Examples: en or en-US.) + /// + [JsonProperty("language")] + public string Language { get; set; } //optional + + /// + /// Indicates whether or not the feed is finished — that is, whether or not it will ever update again. + /// If the value is true, then it’s expired. Any other value, or the absence of expired, means the feed may continue to + /// update. + /// + [JsonProperty("expired")] + public bool? Expired { get; set; } //optional + + /// + /// Endpoints that can be used to subscribe to real-time notifications of changes to this feed. + /// + [JsonProperty("hubs")] + public List Hubs { get; set; } //optional + + /// + /// The individual items in the feed. + /// + [JsonProperty("items")] + public List Items { get; set; } //required + + /// + /// Parses a JsonFeed in an input string into a JsonFeed object for use by code. + /// + /// The JSON Feed as a string. + /// A JsonFeed object representing the parsed feed. + public static JsonFeed Parse(string jsonFeedString) + { + return JsonConvert.DeserializeObject(jsonFeedString); + } + + /// + /// Retrieves a remote feed from the specified Uri and parses it into a JsonFeed object for use by code. + /// + /// The Uri of the JSON Feed to retrieve and parse. + /// Optional: A customer HttpMessageHandler implementation to use for the network requests(s). + /// A JsonFeed object representing the parsed feed. + public static async Task ParseFromUriAsync(Uri jsonFeedUri, HttpMessageHandler httpMessageHandler = null) + { + HttpClient client = new(httpMessageHandler ?? new HttpClientHandler()); + string jsonDocument = await client.GetStringAsync(jsonFeedUri); + + return Parse(jsonDocument); + } + + /// + /// Serializes the JsonFeed object into a JSON string. + /// + /// A string containing the generated feed JSON. + public string Write() + { + return ToString(); + } + + /// + /// Serializes the JsonFeed object into a JSON string and writes it to the provided stream. + /// + /// The stream to write the JSON to. + public void Write(Stream stream) + { + var encoding = new UTF8Encoding(false); + var writer = new StreamWriter(stream, encoding); + writer.Write(this); + writer.Flush(); + } + + /// + /// Serializes the JsonFeed object into a JSON string. + /// + /// A string containing the generated feed JSON. + public override string ToString() + { + return JsonConvert.SerializeObject(this, s_serializerSettings); } } diff --git a/JsonFeedNet/JsonFeedAttachment.cs b/JsonFeedNet/JsonFeedAttachment.cs index a110ec8..1aea45a 100644 --- a/JsonFeedNet/JsonFeedAttachment.cs +++ b/JsonFeedNet/JsonFeedAttachment.cs @@ -1,45 +1,42 @@ -// ReSharper disable ClassNeverInstantiated.Global +namespace JsonFeedNet using Newtonsoft.Json; -namespace JsonFeedNet +/// +/// A related resource to a feed. +/// +public class JsonFeedAttachment { /// - /// A related resource to a feed. + /// The location of the attachment. /// - public class JsonFeedAttachment - { - /// - /// The location of the attachment. - /// - [JsonProperty("url")] - public string Url { get; set; } //required + [JsonProperty("url")] + public string Url { get; set; } //required - /// - /// The mime type of the attachment, such as “audio/mpeg.” - /// - [JsonProperty("mime_type")] - public string MimeType { get; set; } //required + /// + /// The mime type of the attachment, such as “audio/mpeg.” + /// + [JsonProperty("mime_type")] + public string MimeType { get; set; } //required - /// - /// A name for the attachment. - /// If there are multiple attachments that have the exact same title, they are considered as alternate representations - /// of the same thing. - /// In this way a podcaster, for instance, might provide an audio recording in different formats. - /// - [JsonProperty("title")] - public string Title { get; set; } //optional + /// + /// A name for the attachment. + /// If there are multiple attachments that have the exact same title, they are considered as alternate representations + /// of the same thing. + /// In this way a podcaster, for instance, might provide an audio recording in different formats. + /// + [JsonProperty("title")] + public string Title { get; set; } //optional - /// - /// How large the file is. - /// - [JsonProperty("size_in_bytes")] - public long? SizeInBytes { get; set; } //optional + /// + /// How large the file is. + /// + [JsonProperty("size_in_bytes")] + public long? SizeInBytes { get; set; } //optional - /// - /// How long the attachment takes to listen to or watch. - /// - [JsonProperty("duration_in_seconds")] - public long? DurationInSeconds { get; set; } //optional - } + /// + /// How long the attachment takes to listen to or watch. + /// + [JsonProperty("duration_in_seconds")] + public long? DurationInSeconds { get; set; } //optional } diff --git a/JsonFeedNet/JsonFeedAuthor.cs b/JsonFeedNet/JsonFeedAuthor.cs index 5224fb0..1bb82f2 100644 --- a/JsonFeedNet/JsonFeedAuthor.cs +++ b/JsonFeedNet/JsonFeedAuthor.cs @@ -1,31 +1,30 @@ -using Newtonsoft.Json; +namespace JsonFeedNet -namespace JsonFeedNet +using Newtonsoft.Json; + +/// +/// A feed author. +/// +public class JsonFeedAuthor { /// - /// A feed author. + /// The author's name. /// - public class JsonFeedAuthor - { - /// - /// The author's name. - /// - [JsonProperty("name")] - public string Name { get; set; } //optional + [JsonProperty("name")] + public string Name { get; set; } //optional - /// - /// The URL of a site owned by the author. - /// It could be a blog, micro-blog, Twitter account, and so on. - /// - [JsonProperty("url")] - public string Url { get; set; } //optional + /// + /// The URL of a site owned by the author. + /// It could be a blog, micro-blog, Twitter account, and so on. + /// + [JsonProperty("url")] + public string Url { get; set; } //optional - /// - /// The URL for an image for the author. - /// It should be square and relatively large — such as 512 x 512. - /// It should use transparency where appropriate, since it may be rendered on a non-white background. - /// - [JsonProperty("avatar")] - public string Avatar { get; set; } //optional - } + /// + /// The URL for an image for the author. + /// It should be square and relatively large — such as 512 x 512. + /// It should use transparency where appropriate, since it may be rendered on a non-white background. + /// + [JsonProperty("avatar")] + public string Avatar { get; set; } //optional } diff --git a/JsonFeedNet/JsonFeedHub.cs b/JsonFeedNet/JsonFeedHub.cs index 43872c8..691619b 100644 --- a/JsonFeedNet/JsonFeedHub.cs +++ b/JsonFeedNet/JsonFeedHub.cs @@ -1,24 +1,21 @@ -// ReSharper disable ClassNeverInstantiated.Global +namespace JsonFeedNet using Newtonsoft.Json; -namespace JsonFeedNet +/// +/// Endpoint that can be used to subscribe to real-time notifications of changes to a feed. +/// +public class JsonFeedHub { /// - /// Endpoint that can be used to subscribe to real-time notifications of changes to a feed. + /// The type field describes the protocol used to talk with the hub, such as “rssCloud” or “WebSub.” /// - public class JsonFeedHub - { - /// - /// The type field describes the protocol used to talk with the hub, such as “rssCloud” or “WebSub.” - /// - [JsonProperty("type")] - public string Type { get; set; } //required + [JsonProperty("type")] + public string Type { get; set; } //required - /// - /// Url of the hub endpoint. - /// - [JsonProperty("url")] - public string Url { get; set; } //required - } + /// + /// Url of the hub endpoint. + /// + [JsonProperty("url")] + public string Url { get; set; } //required } diff --git a/JsonFeedNet/JsonFeedItem.cs b/JsonFeedNet/JsonFeedItem.cs index dcc9606..068acf0 100644 --- a/JsonFeedNet/JsonFeedItem.cs +++ b/JsonFeedNet/JsonFeedItem.cs @@ -1,127 +1,123 @@ -// ReSharper disable UnusedMember.Global -// ReSharper disable UnusedAutoPropertyAccessor.Global +namespace JsonFeedNet using Newtonsoft.Json; -namespace JsonFeedNet +/// +/// An individual item in a feed. +/// +public class JsonFeedItem { /// - /// An individual item in a feed. + /// The unique identifier for the feed item. + /// If an item is ever updated, the id should be unchanged. + /// New items should never use a previously-used id. + /// Ideally, the id is the full URL of the resource described by the item. /// - public class JsonFeedItem - { - /// - /// The unique identifier for the feed item. - /// If an item is ever updated, the id should be unchanged. - /// New items should never use a previously-used id. - /// Ideally, the id is the full URL of the resource described by the item. - /// - [JsonProperty("id")] - public string Id { get; set; } //required - - /// - /// The URL of the resource described by the feed item. - /// This may be the same as the id. - /// - [JsonProperty("url")] - public string Url { get; set; } //optional - - /// - /// The URL of a page elsewhere. - /// This is especially useful for link blogs. - /// - [JsonProperty("external_url")] - public string ExternalUrl { get; set; } //optional - - /// - /// The title of the feed item. - /// - [JsonProperty("title")] - public string Title { get; set; } //optional - - /// - /// The content of the feed item formatted as plain HTML. - /// This is the only field HTML is allowed in. - /// - [JsonProperty("content_html")] - public string ContentHtml { get; set; } //optional - - /// - /// The content of the feed item formatted as plain text. - /// - [JsonProperty("content_text")] - public string ContentText { get; set; } //optional - - /// - /// Plain text sentence or two describing the item. - /// This might be presented in a timeline, for instance, where a detail view would display all of ContentHtml or - /// ContentText. - /// - [JsonProperty("summary")] - public string Summary { get; set; } //optional - - /// - /// The URL of the main image for the item. - /// This image may also appear in the ContentHtml — if so, it’s a hint to the feed reader that this is the main, - /// featured image. - /// Feed readers may use the image as a preview (probably resized as a thumbnail and placed in a timeline). - /// - [JsonProperty("image")] - public string Image { get; set; } //optional - - /// - /// The URL of an image to use as a banner. - /// Some blogging systems (such as Medium) display a different banner image chosen to go with each post, but that image - /// would not otherwise appear in the ContentHtml. - /// A feed reader with a detail view may choose to show this banner image at the top of the detail view, possibly with - /// the title overlaid. - /// - [JsonProperty("banner_image")] - public string BannerImage { get; set; } //optional - - /// - /// The date the feed item was published. - /// - [JsonProperty("date_published")] - public DateTimeOffset? DatePublished { get; set; } //optional - RFC 3339 format (Example: 2010-02-07T14:04:00-05:00.) - /// - /// The date the feed item was modified. - /// - [JsonProperty("date_modified")] - public DateTimeOffset? DateModified { get; set; } //optional - RFC 3339 format (Example: 2010-02-07T14:04:00-05:00.) - - /// - /// Feed item author. - /// If not specified, then the top-level author, if present, is the author of the item. - /// - [JsonProperty("author")] - [Obsolete("obsolete by specification version 1.1. Use `Authors`")] - public JsonFeedAuthor Author { get; set; } //optional - - [JsonProperty("authors")] - public List Authors { get; set; } //optional - - /// - /// Tags associated with the feed item. - /// Can have any plain text values you want. - /// Tags tend to be just one word, but they may be anything. - /// - [JsonProperty("tags")] - public List Tags { get; set; } //optional - - /// - /// the language for this item in the format specified in RFC 5646. - /// The value is usually a 2-letter language tag from ISO 639-1, optionally followed by a region tag. - /// (Examples: en or en-US.) - /// - [JsonProperty("language")] - public string Language { get; set; } //optional - - /// - /// Related resources for the feed item. - /// Podcasts, for instance, would include an attachment that’s an audio or video file. - /// - [JsonProperty("attachments")] - public List Attachments { get; set; } //optional - } + [JsonProperty("id")] + public string Id { get; set; } //required + + /// + /// The URL of the resource described by the feed item. + /// This may be the same as the id. + /// + [JsonProperty("url")] + public string Url { get; set; } //optional + + /// + /// The URL of a page elsewhere. + /// This is especially useful for link blogs. + /// + [JsonProperty("external_url")] + public string ExternalUrl { get; set; } //optional + + /// + /// The title of the feed item. + /// + [JsonProperty("title")] + public string Title { get; set; } //optional + + /// + /// The content of the feed item formatted as plain HTML. + /// This is the only field HTML is allowed in. + /// + [JsonProperty("content_html")] + public string ContentHtml { get; set; } //optional + + /// + /// The content of the feed item formatted as plain text. + /// + [JsonProperty("content_text")] + public string ContentText { get; set; } //optional + + /// + /// Plain text sentence or two describing the item. + /// This might be presented in a timeline, for instance, where a detail view would display all of ContentHtml or + /// ContentText. + /// + [JsonProperty("summary")] + public string Summary { get; set; } //optional + + /// + /// The URL of the main image for the item. + /// This image may also appear in the ContentHtml — if so, it’s a hint to the feed reader that this is the main, + /// featured image. + /// Feed readers may use the image as a preview (probably resized as a thumbnail and placed in a timeline). + /// + [JsonProperty("image")] + public string Image { get; set; } //optional + + /// + /// The URL of an image to use as a banner. + /// Some blogging systems (such as Medium) display a different banner image chosen to go with each post, but that image + /// would not otherwise appear in the ContentHtml. + /// A feed reader with a detail view may choose to show this banner image at the top of the detail view, possibly with + /// the title overlaid. + /// + [JsonProperty("banner_image")] + public string BannerImage { get; set; } //optional + + /// + /// The date the feed item was published. + /// + [JsonProperty("date_published")] + public DateTimeOffset? DatePublished { get; set; } //optional - RFC 3339 format (Example: 2010-02-07T14:04:00-05:00.) + /// + /// The date the feed item was modified. + /// + [JsonProperty("date_modified")] + public DateTimeOffset? DateModified { get; set; } //optional - RFC 3339 format (Example: 2010-02-07T14:04:00-05:00.) + + /// + /// Feed item author. + /// If not specified, then the top-level author, if present, is the author of the item. + /// + [JsonProperty("author")] + [Obsolete("obsolete by specification version 1.1. Use `Authors`")] + public JsonFeedAuthor Author { get; set; } //optional + + [JsonProperty("authors")] + public List Authors { get; set; } //optional + + /// + /// Tags associated with the feed item. + /// Can have any plain text values you want. + /// Tags tend to be just one word, but they may be anything. + /// + [JsonProperty("tags")] + public List Tags { get; set; } //optional + + /// + /// the language for this item in the format specified in RFC 5646. + /// The value is usually a 2-letter language tag from ISO 639-1, optionally followed by a region tag. + /// (Examples: en or en-US.) + /// + [JsonProperty("language")] + public string Language { get; set; } //optional + + /// + /// Related resources for the feed item. + /// Podcasts, for instance, would include an attachment that’s an audio or video file. + /// + [JsonProperty("attachments")] + public List Attachments { get; set; } //optional } From 3751d158537fa8adb9218e0030cedbe0f986adf2 Mon Sep 17 00:00:00 2001 From: Dan Rigby <114417+DanRigby@users.noreply.github.com> Date: Thu, 13 Jul 2023 20:29:04 -0400 Subject: [PATCH 2/2] :old-man-shakes-fist-at-semicolons: --- JsonFeedNet/JsonFeed.cs | 2 +- JsonFeedNet/JsonFeedAttachment.cs | 2 +- JsonFeedNet/JsonFeedAuthor.cs | 2 +- JsonFeedNet/JsonFeedHub.cs | 2 +- JsonFeedNet/JsonFeedItem.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/JsonFeedNet/JsonFeed.cs b/JsonFeedNet/JsonFeed.cs index 88c99ab..a32d954 100644 --- a/JsonFeedNet/JsonFeed.cs +++ b/JsonFeedNet/JsonFeed.cs @@ -1,4 +1,4 @@ -namespace JsonFeedNet +namespace JsonFeedNet; using System.Text; using Newtonsoft.Json; diff --git a/JsonFeedNet/JsonFeedAttachment.cs b/JsonFeedNet/JsonFeedAttachment.cs index 1aea45a..ab3cb12 100644 --- a/JsonFeedNet/JsonFeedAttachment.cs +++ b/JsonFeedNet/JsonFeedAttachment.cs @@ -1,4 +1,4 @@ -namespace JsonFeedNet +namespace JsonFeedNet; using Newtonsoft.Json; diff --git a/JsonFeedNet/JsonFeedAuthor.cs b/JsonFeedNet/JsonFeedAuthor.cs index 1bb82f2..15431f2 100644 --- a/JsonFeedNet/JsonFeedAuthor.cs +++ b/JsonFeedNet/JsonFeedAuthor.cs @@ -1,4 +1,4 @@ -namespace JsonFeedNet +namespace JsonFeedNet; using Newtonsoft.Json; diff --git a/JsonFeedNet/JsonFeedHub.cs b/JsonFeedNet/JsonFeedHub.cs index 691619b..ef89e83 100644 --- a/JsonFeedNet/JsonFeedHub.cs +++ b/JsonFeedNet/JsonFeedHub.cs @@ -1,4 +1,4 @@ -namespace JsonFeedNet +namespace JsonFeedNet; using Newtonsoft.Json; diff --git a/JsonFeedNet/JsonFeedItem.cs b/JsonFeedNet/JsonFeedItem.cs index 068acf0..64e98f9 100644 --- a/JsonFeedNet/JsonFeedItem.cs +++ b/JsonFeedNet/JsonFeedItem.cs @@ -1,4 +1,4 @@ -namespace JsonFeedNet +namespace JsonFeedNet; using Newtonsoft.Json;