cashapp / misk

Microservice Kontainer
https://cashapp.github.io/misk/
Apache License 2.0
399 stars 169 forks source link

Improves calculateTypes: adds returnTypes, recurses into map value ty… #3286

Closed brunofrts closed 3 months ago

brunofrts commented 4 months ago

…pes and generate Kotlin test classes through Wire.

This PR

  1. Introduces returnTypes (similar to responseTypes) in WebActionMetadata. This is useful when the return of a web action is not wrapped (e.g., in a Response).
  2. Removes the hardcoded Kotlin Wire compiled test classes in misk-admin and instead generates them with Gradle as needed. To do this, we duplicate the .proto definitions using different package names so that Wire can process both with different outputs.
  3. Implements Map handling in calculateTypes similarly to how we parse Lists.
brunofrts commented 3 months ago

This PR is temporarily blocked (due to item 2 in description) by the unexpected Wire behavior described in this Slack thread.

oldergod commented 3 months ago

I wrote a fixes #<this PR> in the related Wire PR and this closed this issue.... Sorry about it.

brunofrts commented 3 months ago

Tested with Wire-5.0.0-alpha03 locally and working as expected. Merging.