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

Incomplete type declaration in interface FeedData for property description #137

Open
WetHat opened this issue Jun 14, 2024 · 3 comments
Open

Comments

@WetHat
Copy link

WetHat commented Jun 14, 2024

In the interface FeedData the property decription is declared as:

description?: string;

However sometimes the description element in the parsed RSS feed is returned as object:

"description": {
    "#text": "Updates, ideas, and inspiration from GitHub to help developers build and design software.",
    "@_type": "text"
  },

To accurately reflect this situation the FeedData interface could be changed like so:

/**
 * Type for property bag objects (key -> value) with unknown content.
 */
export type TPropertyBag = { [key: string]: any };

export interface FeedData {
  link?: string;
  title?: string;
  description?: string | TPropertyBag ;
  generator?: string;
  language?: string;
  published?: string;
  entries?: Array<FeedEntry>;
}

Alternatively, the extractor could desctructure the description element and just return the string.

feed.zip

@ndaidong
Copy link
Collaborator

@WetHat if you mentioned to https://github.blog/product.atom, this is standard ATOM format and it should work welll:

Screenshot from 2024-06-14 19-17-39

@WetHat WetHat changed the title Incomplete type declaration in interface FeedEntry for property title Incomplete type declaration in interface FeedData for property description Jun 14, 2024
@WetHat
Copy link
Author

WetHat commented Jun 14, 2024

My mistake, sorry. I had this issue a while ago (build error) and remembered it had to do with an element attribute. When I looked at the xml file I did not find the description element and thought it must have been the title. I totally missed the point that this is an ATOM feed that the extractor returns the subtitle as feed description. However, the feed description is an object and not a string (see screenshot).

image

I've updated the issue.

@ndaidong
Copy link
Collaborator

@WetHat thank you, let me try to fix this.

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

No branches or pull requests

2 participants