Closed Ladicek closed 2 months ago
This is my proposal for https://github.com/vert-x3/wiki/wiki/5.0.0-Deprecations-and-breaking-changes:
RedisOptions
The RedisOptions
class has multiple methods to configure the Redis endpoints. These methods are still available, but the JSON format of this class has changed to only include one canonical field: endpoints
.
If you rely on the JSON form of RedisOptions
objects, note that the endpoint
, connectionString
and connectionStrings
members of the JSON object are no longer recognized by the deserializer and are no longer generated by the serializer. Ensure that the necessary information is present in the endpoints
member.
If you do not rely on the JSON form of RedisOptions
objects, this change does not affect you.
The
RedisOptions
class has a fieldendpoints
of typeList<String>
for which multiple accessors and mutators exist:getEndpoints()
: the canonical gettersetEndpoints()
: the canonical settergetEndpoint()
: returns the first element of the listsetEndpoint()
: turns the list into a single-element listaddEndpoint()
: adds one element to the listsetConnectionString()
: same assetEndpoint()
addConnectionString()
: same asaddEndpoint()
The
RedisConnectOptions
class, which ispublic
but is only used internally, has the same problem.All these methods are treated as individual properties by the code generator that produces the JSON serialization/deserialization classes, even though they are all backed by a single field. Since the code generator considers properties in declaration order (in upcoming Vert.x 5; it is lexicographic order in Vert.x 4), we had to reorder the methods so that serialization and deserialization does not lose information.
That is arguably a provisional solution, as it is very much not obvious that declaration order matters. This commit provides a permanent solution: all the non-canonical methods are marked as
@GenIgnore
. Only thegetEndpoints()
andsetEndpoints()
methods are used for serialization/deserialization.This is a breaking change, so it shall not be backported to Vert.x 4 and shall be documented as such.