v0.2.0 Cleanup and address conflicting names
This release addresses edge cases in how we chose to generate and name API methods. The major changes are as follows:
- The JacksonBodyHandler has been removed. We now favor using the BodyHandlers.ofInputStream handler instead, which lets us lazily deserialize responses and gracefully handle deserialization errors.
- The "otherOperations" and "allOperations" operation groups are now the "everyUntaggedOperation" and "everyOperation" groups. This avoids problems created when a specification uses the "all" and "other" tags.
- Most importantly, parameters are no longer configured directly on the operation API. Previously, if an API specified two parameters named "foo" in different locations like the path and query (which is valid), Lily would try to define a single
foo(...)
setter on the operation and fail. Because parameters are unique by name and location, we now configure parameters based on their location using callbacks:
var response = api
.everyOperation()
.doAThing()
.path(path -> path
.id("1234"))
.query(query -> query
.foo("foo")
.bar("bar"))
.sendSync();
Callbacks isolate parameters by location so that names never conflict, and as a result, we can continue using short setter functions. The callback functions also act like anonymous namespaces, so the user doesn't need to import whatever class the generated API uses to set path parameters, query parameters, and so on. It's a small convenience.