https://github.com/eclipse-ee4j/yasson
Eclipse Yasson project
https://github.com/eclipse-ee4j/yasson
Last synced: 8 months ago
JSON representation
Eclipse Yasson project
- Host: GitHub
- URL: https://github.com/eclipse-ee4j/yasson
- Owner: eclipse-ee4j
- License: other
- Created: 2016-11-18T14:46:19.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-17T15:13:21.000Z (over 1 year ago)
- Last Synced: 2024-10-30T20:45:53.005Z (about 1 year ago)
- Language: Java
- Homepage: https://projects.eclipse.org/projects/ee4j.yasson
- Size: 3.37 MB
- Stars: 203
- Watchers: 20
- Forks: 95
- Open Issues: 110
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-java - Yasson - Binding layer between classes and JSON documents similar to JAXB. (Projects / JSON)
- awesome-java-zh - Yasson - 类和JSON文档之间的绑定层,类似于JAXB。 (项目 / JSON)
- fucking-awesome-java - Yasson - Binding layer between classes and JSON documents similar to JAXB. (Projects / JSON)
- awesome-java - Yasson - Binding layer between classes and JSON documents similar to JAXB. (Projects / JSON)
README
# Eclipse Yasson
[](https://mvnrepository.com/artifact/org.eclipse/yasson)
[](https://jakarta.oss.sonatype.org/content/repositories/staging/org/eclipse/yasson/)
[](https://gitter.im/eclipse/yasson)
[](https://www.javadoc.io/doc/org.eclipse/yasson)
[](https://github.com/eclipse-ee4j/yasson/actions/workflows/maven.yml?branch=master)
[](https://opensource.org/licenses/EPL-2.0)
Yasson is a Java framework which provides a standard binding layer between Java classes and JSON documents. This is similar to what JAXB is doing in the XML world. Yasson is an official reference implementation of JSON Binding ([JSR-367](https://jcp.org/en/jsr/detail?id=367)).
It defines a **default mapping** algorithm for converting existing Java classes to JSON suitable for the most cases:
```java
Jsonb jsonb = JsonbBuilder.create();
String result = jsonb.toJson(someObject);
```
For whom it's not enough it provides rich customization abilities through a set of **annotations** and rich **programmatic API**:
```java
// Create custom configuration
JsonbConfig config = new JsonbConfig()
.withNullValues(true)
.withFormatting(true);
// Create Jsonb with custom configuration
Jsonb jsonb = JsonbBuilder.create(config);
// Use it!
String result = jsonb.toJson(someObject);
```
## Questions?
Something not working right? Have an idea for an enhancement? Get in touch with the Yasson community in the following ways:
- [Gitter](https://gitter.im/eclipse/yasson): a free instant-messaging platform (similar to Slack) that anyone can join.
- [Stackoverflow](https://stackoverflow.com/questions/tagged/yasson): As a question tagged `[jsonb-api]` and `[yasson]`
- [Github Issues](https://github.com/eclipse-ee4j/yasson/issues/new): Open issues for enhancement ideas or bug reports
## Licenses
- [Eclipse Distribution License 1.0 (BSD)](https://projects.eclipse.org/content/eclipse-distribution-license-1.0-bsd)
- [Eclipse Public License 2.0](https://projects.eclipse.org/content/eclipse-public-license-2.0)
## Links
- Yasson home page: https://projects.eclipse.org/projects/ee4j.yasson
- JSON-B official web site: https://eclipse-ee4j.github.io/jsonb-api/
- JSON-B API & spec project: https://github.com/eclipse-ee4j/jsonb-api
- JSR-367 page on JCP site: https://jcp.org/en/jsr/detail?id=367