{"id":16187225,"url":"https://github.com/mwanji/jsonfeed4j","last_synced_at":"2025-10-25T14:11:30.396Z","repository":{"id":57726715,"uuid":"93197513","full_name":"mwanji/jsonfeed4j","owner":"mwanji","description":"A JSON Feed (https://jsonfeed.org) reader and writer for Java 1.8+","archived":false,"fork":false,"pushed_at":"2017-06-19T08:43:14.000Z","size":49,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T13:43:14.718Z","etag":null,"topics":["jsonfeed"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwanji.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-02T19:28:23.000Z","updated_at":"2023-04-25T13:26:29.000Z","dependencies_parsed_at":"2022-09-26T21:50:59.875Z","dependency_job_id":null,"html_url":"https://github.com/mwanji/jsonfeed4j","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mwanji/jsonfeed4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwanji%2Fjsonfeed4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwanji%2Fjsonfeed4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwanji%2Fjsonfeed4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwanji%2Fjsonfeed4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwanji","download_url":"https://codeload.github.com/mwanji/jsonfeed4j/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwanji%2Fjsonfeed4j/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259860437,"owners_count":22922989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jsonfeed"],"created_at":"2024-10-10T07:20:46.945Z","updated_at":"2025-10-25T14:11:25.364Z","avatar_url":"https://github.com/mwanji.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsonfeed4j\n\njsonfeed4j is a [JSON Feed](https://jsonfeed.org) reader and writer for Java 8+.\n\n## Installation\n\nRequires Java 1.8 or above.\n\nAdd the following dependency to your POM (or equivalent for other dependency managers):\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.moandjiezana.jsonfeed\u003c/groupId\u003e\n  \u003cartifactId\u003ejsonfeed4j-gson\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nThis binds jsonfeed4j to the Gson JSON library. If you wish to use another JSON library, you must implement your own `JsonFeedReader`.\n\n## Quick Start\n\n```java\nJsonFeed jsonFeed = new GsonJsonFeedReader().read(getJsonFeedFile());\nSystem.out.println(\"Author: \" + jsonFeed.getAuthor().orElse(\"\"));\njsonFeed.getItems().stream().map(Item::getUrl).forEach(System.out::println);\n```\n\n## Validation\n\njsonfeed4j uses standard [Bean Validation 1.1](http://beanvalidation.org) ([spec](http://beanvalidation.org/1.1/spec/)) annotations to enforce JSON Feed's required fields. However, no implementation is included, so validation can be performed with whichever implementation you prefer, such as Hibernate Validator. Custom validators are provided for cases in which there are several optional fields, but at least one must be present. Examples include `item.content_text` and `item.content_text`.\n\nOptional fields are wrapped in an `Optional` to make it obvious.\n\n```java\nValidator validator = getValidator();\nJsonFeed jsonFeed = getJsonFeed();\n\nSet\u003cConstraintViolations\u003c?\u003e\u003e violations = validator.validate(jsonFeed);\n```\n\n## Extensions\n\nJSON Feed allows extensions at every level. All jsonfeed4j model classes have a `Extensions getExtensions()` method. From the `Extensions` object, you can retrieve the extension's root by its name without the underscore. For example:\n\n```json\n{\n  \"_plugin1\": {\n    \"key\": \"value\"\n  },\n  \"_plugin2\": [ \"a\", \"b\", \"c\"],\n  \"_plugin3\": \"value2\",\n  \"items\": [\n    {\n      \"id\": \"http://example.org/1\",\n      \"content_text\": \"Some text\",\n      \"_plugin4\": 1234\n    }\n  ]\n}\n```\n\n```java\nJsonFeed jsonFeed = getJsonFeed();\nExtensions topLevelExtensions = jsonFeed.getExtensions();\n\nMap\u003cString, ?\u003e plugin1 = topLevelExtensions.getMap(\"plugin1\");\nList\u003c?\u003e plugin2 = topLevelExtensions.getList(\"plugin2\");\nObject plugin3 = topLevelExtensions.get(\"value2\");\nObject plugin4 = jsonFeed.getItems().get(0).getExtensions().get(\"plugin4\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwanji%2Fjsonfeed4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwanji%2Fjsonfeed4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwanji%2Fjsonfeed4j/lists"}