eed3si9n / scalaxb

scalaxb is an XML data binding tool for Scala.
http://scalaxb.org/
MIT License
337 stars 156 forks source link

Add support for http4s `0.22.x` client generation - `httpclients_http4s_0_22.scala.template` #601

Closed kevin-lee closed 1 year ago

kevin-lee commented 1 year ago

Add support for http4s 0.22.x client generation - httpclients_http4s_0_22.scala.template

I have to use http4s 0.22.15, but scalaxb's http4s client generation seems to support only 0.21 and 0.23. I've tested it locally with publishLocal, and it works fine. I hope this PR is approved.

Please let me know if I missed anything or need to do anything else.

eed3si9n commented 1 year ago

I am not really familiar with http4s, but do they have to be different for each releases? In other words, can 0.22+ use the same code? /cc @zarthross

kevin-lee commented 1 year ago

I am not really familiar with http4s, but do they have to be different for each releases? In other words, can 0.22+ use the same code? /cc @zarthross

@eed3si9n http4s 0.21 and 0.22 use cats-effect 2, whereas 0.23 uses cats-effect 3. The template for 0.23 seems compatible with 0.22, but there can be some issues.

  1. If any cats-effect 3 specific types are added to the template for 0.23 in the future, it will break the 0.22 one.
  2. 0.22 has breaking changes from 0.21, so the template is incompatible.
kevin-lee commented 1 year ago

I don't want to add more maintenance cost to scalaxb, so if this is merged and there's any issue with that template I've added in the future, please let me know. I'll be more than happy to fix it.

kevin-lee commented 1 year ago

Thanks for your approval @eed3si9n. It would be good to have @zarthross's feedback as well.

kevin-lee commented 1 year ago

Thanks, @zarthross, for http4s client support. The real credit for this PR should be all yours, as the template is the same as yours except for removing unused imports. I still had to put the template due to the reason I mentioned above.