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

Allow Loading of predefined JSON (static) objects #35

Open
ReeceM opened this issue Dec 21, 2022 · 0 comments
Open

Allow Loading of predefined JSON (static) objects #35

ReeceM opened this issue Dec 21, 2022 · 0 comments
Labels
enhancement New feature or request in review Issues that are currently being reviewed

Comments

@ReeceM
Copy link
Owner

ReeceM commented Dec 21, 2022

When using this on another platform, the data might be already there from other sources (my situation). Rather than make another API call to url, I propose having another parameter, eg announcements, which would have the content as returned by the API, eg

announcements: [
{
"url": "https://api.github.com/repos/ReeceM/h-bar/releases/27306040",
"assets_url": "https://api.github.com/repos/ReeceM/h-bar/releases/27306040/assets",
"upload_url": "[https://uploads.github.com/repos/ReeceM/h-bar/releases/27306040/assets{?name,label}](https://uploads.github.com/repos/ReeceM/h-bar/releases/27306040/assets%7B?name,label})",
"html_url": "https://github.com/ReeceM/h-bar/releases/tag/2.0.0-rc1",
"id": 27306040,
"author": {
...

One could set either announcements or url in the init() call. If announcements is set, just skip fetching content from URL and proceed with next step, probably parser.

This extents the usability of this library to many other cases, rather than being forced to load content from an URL.

Originally posted by @mariusa in #28 (comment)

@ReeceM ReeceM added enhancement New feature or request in review Issues that are currently being reviewed labels Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in review Issues that are currently being reviewed
Projects
None yet
Development

No branches or pull requests

1 participant