-
Notifications
You must be signed in to change notification settings - Fork 472
#340 - Adds new Affordances API + HAL-Forms mediatype #612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
72cd3f3
to
02d188c
Compare
f96f034
to
be4649e
Compare
3eb64ac
to
f5bf966
Compare
544edcd
to
217cd66
Compare
@olivergierke I rebased this PR and got all the test cases to work (again). Also migrated many MORE test cases to AssertJ in the process. It has probably undone some of your polishing from the 2nd commit. Additionally, I used the IDE to complete several other polishings that are Java 8-based, and that is the 3rd commit. I can understand if you'd prefer cherry picking that separately. Also, all of this work somehow caused an ALPS test case to break simply due to Jackson and property ordering. I looked up the ALPS spec and adjusted the serializer to order things properly and patched the test case. Again, I can understand opening a separate issue and cherry picking that commit as well. As a side effect of reading the ALPS spec, it appears the "descriptors" should actually be "descriptor" so I opened #665 but opted to not go THAT far out of scope. :) Hopefully we are close to merging things, however that needs to be done ultimately. Once done, I can certainly invest some effort in Spring Data REST's Lovelace version to enhance all those controllers to leverage affordances and have an instant increase in usability before circling back to more mediatypes. ;) |
Moved AffordanceModelFactory into core package as it's SPI. Switched to Spring Factories lookup of implementation classes so that we avoid a package dependency between the MVC package and the media type specific packages. Removed reference to MediaType from AffordanceModelFactory to AffordanceModel so that a factory can even provide models for different MediaTypes (i.e. different flavors of the same one, e.g. HAL Forms for JSON and XML). Also removed addAffordanceModel(…) from Affordance to not force the implementations into mutability. Made most of the affordance building API types package protected. HalFormsAffordanceModel now uses MethodParameters abstraction to simplify model parsing code. Tweaked HAL forms model to work with factory methods for required properties and wither methods to add optional properties. Tweaked and inlined mixin types in Jackson module for HAL forms. Slight API polishing on Link to make sure Affordance collecting methods are not named with…. Tweaked Lombok setup to use all caps for logger constants. Removed deprecation warnings in Jackson2HalModule.
Used IDE to migrate several Java 6 constructors to Java 8.
Side effect of upgrading Jackson appears to be arbitrary change in order of property serialization. This commit forces the order to match the spec and fixes the related test cases.
217cd66
to
f631798
Compare
Original pull-request: #340, #447, #581
Related issues: #503, #334, #71