Releases: infinum/kotlin-jsonapix
1.0.3
1.0.2
What's Changed
- Implement support for repeatable Error, Links and Meta annotations by @DrakslerT in #69
- Fix encoding root meta,links and errors in XList models by @thisAAY in #64
Full Changelog: 1.0.1...1.0.2
v1.0.1
v1.0.0
JsonApiX: First Stable Release
Enhancements:
- Upgraded Kotlin to 1.9.20.
- Updated Gradle to 8.2.0.
- Migrated to JDK 17.
Bug Fixes:
- Issue with HasOne/HasMany Annotations: Resolved a serialization issue where fields using HasOne or HasMany annotations were serialized by their field names, ignoring the @SerialName annotation. This previously forced users to match response property names with their casing (like snake case) as defined in the response. Now, fields are correctly serialized respecting the @SerialName annotation, allowing for more flexible and consistent naming conventions.
New Features:
- Support for Nullable Primary Data.
- Meta Support for relationships and resource objects.
Breaking Changes:
-
Introduction:
The latest updates to JsonApiX tackle the issue of losing access to root information in list scenarios, such asList<Person>
. This problem arose from using the samePerson
class for both single objects and lists, leading to confusion, especially in accessing meta information. To improve this, we have implemented significant changes. -
For Single Objects:
The previous direct use ofPerson
in single object scenarios did not effectively encapsulate JSON API data.Don't 🚫 (Old Way):
val person: Person = getPerson() // Direct use of Person class without clear JSON API data encapsulation.
Do ✅ (New Approach):
val personModel: PersonModel = getPerson() // Using PersonModel provides better structure and clarity.
-
For Lists:
Previously, usingList<Person>
led to ambiguity in meta access, making it difficult to determine whether operations likeperson.first().meta
were accessing root or resource meta.Don't 🚫 (Old Way):
val person: List<Person> = getPersons() val meta = person.first().meta // Ambiguity in meta access.
Do ✅ (New Approach):
val persons: PersonList = getPersonList() val rootMeta = persons.rootMeta // Clear access to root meta. val resourceMeta = persons.first().resourceObjectMeta // Specific resource meta access.
v1.0.0-beta02
Updated dependencies and resolved breaking changes in Kotlin Poet API.
Shout out to @howardtamhk for contributing to this release!
v1.0.0-beta01
New features:
- Custom error model definitions with a new annotation
JsonXError
- Optional lint that warns about annotation usage errors
Fixes:
- Fixed all known issues
Shout out and kudos to @oradkovsky for reporting and resolving one of the alpha version issues!
v1.0.0-alpha02
Fixed all known issues with parsing nullable fields from JSON:API string
v1.0.0-alpha
Initial alpha release. Contains all the core features for parsing JSON API between kotlin classes and JSON API strings