All Versions
1081
Latest Version
Avg Release Cycle
3 days
Latest Release
1307 days ago

Changelog History
Page 104

  • v0.21.1 Changes

    • No changes (accidental publish)
  • v0.21.0 Changes

    (RB=64609) ➕ Add Java custom class binding support for primitive type. You add a custom class binding by using a typeref with a "java" property.

    The "java" property of the typeref declaration must be a map. If this map has an "class" property, then the value of the "class" property must be a string and this string provides the name of the Java custom class for the typeref.

    The generated code will now return and accept the Java custom class as the return and argument type instead of the standard Java class for the referenced type.

    The custom class should meet the following requirements.

    1. An instance of the custom class must be immutable.
    2. A Coercer must be defined that can coerce the standard Java class of the type to the custom Java class of the type, in both the input and output directions. The coercer implements the DirectCoercer interface.
    3. An instance of the coercer must be registered with the data template framework.

    The following is an example illustrating Java custom class binding:

    CustomPoint.pdsc:

    { "type" : "typeref", "name" : "CustomPoint", "ref" : "string", "java" : { "class" : "com.linkedin.data.template.TestCustom.CustomPoint" } }

    CustomPoint.java:

    // // The custom class // It has to be immutable. // public class CustomPoint { private int _x; private int _y;

    public CustomPoint(String s) { String parts[] = s.split(","); _x = Integer.parseInt(parts[0]); _y = Integer.parseInt(parts[1]); }

    public CustomPoint(int x, int y) { _x = x; _y = y; }

    public int getX() { return _x; }

    public int getY() { return _y; }

    public String toString() { return _x + "," + _y; }

    public boolean equals(Object o) { if (o == null) return false; if (this == o) return true; if (o.getClass() != getClass()) return false; CustomPoint p = (CustomPoint) o; return (p._x == _x) && (p._y == _y); }

    // // The custom class's DirectCoercer. // public static class CustomPointCoercer implements DirectCoercer { @Override public Object coerceInput(CustomPoint object) throws ClassCastException { return object.toString(); }

    @Override
    public CustomPoint coerceOutput(Object object)
      throws TemplateOutputCastException
    {
      if (object instanceof String == false)
      {
        throw new TemplateOutputCastException("Output " + object + " is not a string, and cannot be coerced to " + CustomPoint.class.getName());
      }
      return new CustomPoint((String) object);
    }
    

    }

    // // Automatically register Java custom class and its coercer. // static { Custom.registerCoercer(CustomPoint.class, new CustomPointCoercer()); } }

  • v0.20.6 Changes

    (RB=64647) If a required field is missing, add Message for both the record and the missing field. ✅ Modify test cases to test for paths reported as having failed.

    (RB=64183) Throw NPE more consistently when attempting to add null elements to array templates or ➕ adding null values to map templates. Previously, NPE will be thrown but not as consistently and may not indicate that the input argument cannot be null.

    Previously, attempting to add null to DataMap and DataList results in IllegalArgumentException. Now, this will throw NPE.

  • v0.20.5 Changes

    (RB=62385) 🛠 Fix Avro schema converter such that default values for Avro unions can translated correctly. 0️⃣ Prior to this fix, the default value for an Avro union is encoded like similar using the JSON 0️⃣ serialization of the default value. The Avro specification specifies that the default value for an union does not include the type discriminator, and the type is provided by the 1st member of the union.

    0️⃣ When a Data Schema is translated to an Avro Schema, if the union has a default value, 0️⃣ the default value's type must be the 1st member type of the union. Otherwise, an IllegalArgumentException will be thrown. When a value of an union type is translated, its translated value will not include the type discriminator.

    When an Avro Schema is translated to a Data Schema, if the Avro union has a value, 📜 the parser and validation function obtains the type of the value from the 1st member type 0️⃣ of union. The translated default value will include a type discriminator if translated type 🌐 remains a union after translation. (The translated type will not be a union if the Avro union is the type for a field of a record and this union type has two members and one of them is null as the field will become an optional field whose type is the non-null member type of the union.)

    0️⃣ Avro schema parser does not validate default values are valid, i.e. it does not validate the 0️⃣ default value for each field with the schema for the field. Pegasus schema parser will perform this validation.

    (RB=62715) ➕ Add support for BatchResponseKV in BatchGet, which provides correctly typed Map keys for getResults() and getError(). 🚀 Convert clients to generate multi-valued params for batch requests, e.g., GET /resource?ids=1&ids=2. Server-side support for this format has been in pegasus since 0.18.5, and has been deployed for all production use cases

  • v0.20.4 Changes

    (RB=61006) ➕ Add include functionality to record, record can include fields from another record. 🔀 Include does not include or attempt to merge any other attributes from the included record, including validate field (this is a TBD feature).

    (RB=61411) 🛠 Fix bug handling default query parameter values for enum types.

    (RB=58634) Internal cleanup of JSON handling in RestLiResourceModelExporter/RestRequestBuilderGenerator

  • v0.20.3 Changes

    (RB=60050) Re-enable action parameter validation, using fix-up mode to ensure that wire types are correctly coerced to schema types.

    (RB=60193) 0️⃣ Make fixup the default enabled for ValidationOptions.

  • v0.20.2 Changes

    (RB=59945) Disable Action parameter validation since it fails when the schema declares a type of long but the value on the wire is less than MAX_INT.

  • v0.20.1 Changes

    (RB=59681) ⬇️ Reduce unintentional memory retention by R2 timeout mechanism.

  • v0.20.0 Changes

    • Same as 0.19.7. Bumped minor version due to backward incompatibility
  • v0.19.7 Changes

    (RB=48204) Implemented correct initialization of InjectResourceFactory. This is an incompatible change for users of InjectResourceFactory and container/pegasus-restli-server-cmpt. To fix, you need to define an InjectResourceFactory bean in the your application's spring context and wire it in to rest.li server e.g.