rest.li v0.15 Release Notes

  • โž• Add pluggable validator to Data Schemas (RB=41693)

    1. Change behavior of ObjectIterator to include returning the input value.

    ๐Ÿ‘€ 2. See com.linkedin.data.validator package and TestValidator class for how to use validators.

    1. This is still a prototype feature.

    Output Avro-compliant equivalent JSON from Pegasus schema (RB=41878)

    โž• Add translation between Pegasus DataMap and Avro GenericRecord (RB=42130)

    ๐Ÿ”จ 1. Also include refactoring of DataSchema to JSON encoding to move Avro specific code out of cow module into cow-avro module.

    โšก๏ธ Rest.li support for full and partial updates Full update (overwrite) is transported as an HTTP PUT to the entity URI, ๐Ÿ›ฐ with a payload containing the JSON serialized RecordTemplate of the entity schema.

    Partial update (patch) is transported as an HTTP POST to the entity URI, ๐Ÿ›ฐ with a payload containing a JSON serialized PatchRequest

    The internal structure of a PatchRequest is documented here: โšก๏ธ https://iwww.corp.linkedin.com/wiki/cf/display/ENGS/Partial+Update

    PatchRequests can be generated on the client side by "diff'ing" two RecordTemplate objects using PatchGenerator in com.linkedin.restli.client.utility. Patch Generation relies on the facilities from the data-transform pegasus ๐Ÿ“ฆ component, in the com.linkedin.data.transform package.

    PatchRequests can be applied on the server side by providing a pre-image RecordTemplate object and a PatchRequest to PatchApplier in com.linkedin.restli.server.util. Patch application uses the DataMapProcessor from the pegasus data-transform component.

    โšก๏ธ Full and Partial update are provided as overloaded update() methods in CollectionResource/AssociationResource on the server-side and as overloaded โšก๏ธ buildUpdate() methods in EntityRequestBuilder on the client-side.

    โšก๏ธ PARTIAL_UPDATE is defined as a new ResourceMethod, and listed as appropriate ๐Ÿ‘ in the IDL "supports" clause of the resource.

    ๐Ÿ‘Œ Support for deep (nested) projections has been implemented: Server-side, the rest.li framework understands both the old "field1,field2,field3" ๐Ÿ’… syntax and the new PAL-style "field1,field2:(nestedfield)" syntax. Projections are applied automatically by the framework, using pegasus data-transform. ResourceContext provides access to the projections as either a Set or a MaskTree.

    Client-side, the generated RecordTemplate classes have been modified to provide fields as a nested class accessed through the .fields() static method. Each field can be accessed as a Path object through a fieldName() method, which provides full static typing. Fields are provided as methods rather than member variables to avoid initialization cycles when a RecordTemplate contains a field of the same type.

    Deep projection support is currently disabled on the client side, to avoid ordering ๐Ÿš€ issues with deployment. Once all services have been deployed to production with the ๐Ÿ†• new pegasus version, we will enable deep projections on the client side.

    ๐Ÿ‘ More background on projection support is available here: https://iwww.corp.linkedin.com/wiki/cf/display/ENGS/Projections

    Compatibility: โšก๏ธ WIRE: This change is wire INCOMPATIBLE for existing users of update. There are โšก๏ธ no known uses of update in production.

    โšก๏ธ CLIENT: This change is library INCOMPATIBLE for users of update, projection fields, ๐Ÿ— or code that relies on the types of framework ...Builder classes (a type parameter has โฌ†๏ธ been removed). Client code will need to be upgraded.

    โšก๏ธ SERVER: This change is library INCOMPATIBLE for users of update. Server code will โฌ†๏ธ need to be upgraded to use PatchRequests and PatchApplier.


    ๐Ÿ”จ Validation code refactoring.

    ๐Ÿšš 1. Move validation code out of DataSchema classes, enable single pass validation of schema and calling validator plugins. ๐Ÿ“ฆ 2. Move schema validation code into validation package. ๐Ÿ“ฆ 3. Move validator plugins into validator package.

    1. Provide field specific diagnostic data from schema validator.

    ๐Ÿ“‡ Rename cow and cow-avro module to data and data-avro module.

    ๐Ÿ”จ Refactor Cow classes and provide implementation that have the checker functionality but without copy-on-write, known as CheckedMap and CheckedList classes.


    (RB=42905)

    โž• Add support for "validate" annotation on fields.

    Prefix DataElement accessor methods with "get".


    (RB=43002)

    โž• Add support for filtering calls to a Validator based on what has been set as specified by the patch operations map. This functionality is implemented by the PatchFilterValidator class.

    Refactored ValidationMessage* classes into Message* classes so that patch operations can re-use these classes for generating patch messages.