jakehschwartz/finatra-swagger

Requiring `Product` for a request type

eikek opened this issue · 3 comments

eikek commented

Hi!
we have request bodies that are lists, so we are using the .request[List[Something]] method on FinatraOperation. When going to Scala 2.13, the List type doesn't extend Product anymore, which is defined as a type constraint on this method. From a very quick look (I'm sorry if this is a too quick conclusion), it looks like it is not necessary? Can this type constraint be removed or am I missing something?

Thank you and thank you for this library!

Edit: here is a link to what I'm talking about:

def request[T <: Product : TypeTag](implicit openAPI: OpenAPI): Operation = {

Hey @eikek. Honestly, I have no idea what a Product is. I've mostly been maintaining the library with new versions of OpenAPI and Finatra, I havent touched a lot of the original code so I dont know what the intent is.

Happy to take PRs with some tests that prove its fine to change! :)

eikek commented

Hey @jakehschwartz thank you, I understand, np! I will try finding some time to take a closer look. Regarding tests: if the code compiles without that constraint, it should be good imho, it means it is not being used anyways. But I'll try to also get some tests for it, don't hold your breath though ;-)

Hahaha, yeah making sure there is something in the examples folder that compiles like you said is plenty!