-
Notifications
You must be signed in to change notification settings - Fork 50
Options and other containers don't work with boxed types #31
Comments
What version are you using? We'll need to investigate since from 0.4 On Jul 21, 2014, at 6:47 AM, Lawrence Wagerfield [email protected] Boxed types are treated as Object types when used as type parameters within For example, the following case class... case class Foo(stringSeq: Seq[String], stringOpt: Option[String], intSeq: ... produces the following api-doc JSON snippet: { Notice how the type information for Int is lost but String remains. — |
Using 0.4.3 |
Sorry for the really late response on this. Did you try bumping to the latest version? 0.4 would be the closest backwards compatible one. We were originally doing our own custom annotation parsing but since 0.4 we switch to swagger-core. This should more closely align with what swagger does. Let me know if that works and again, sorry for the delay. |
I have also reproduced this in version 0.4.6 (i.e., after the switch to use swagger-core). "Foo" : { |
Thanks for the follow up. We'll need to look into this and see what we can On Thursday, November 6, 2014, gorgonblot [email protected] wrote:
|
I have created a BoxedTypesTest in Swagger-Core and made a modification that results in: "intSeq" : { It requires specifying the dataType in the annotation. See the version of swagger-core at: https://github.com/gorgonblot/swagger-core/tree/contrib/issue31 |
Very nice. Let's keep this open and I'll be sure to bump the core version when it's merged upstream. |
I'm dealing with this now .... I'm not exactly sure what the work around is here?? |
One workaround for Option[Int] case is using Option[Integer] instead. |
Boxed types are treated as
Object
types when used as type parameters within Api Models.For example, the following case class...
case class Foo(stringSeq: Seq[String], stringOpt: Option[String], intSeq: Seq[Int], intOpt: Option[Int])
... produces the following api-doc JSON snippet:
Notice how the type information for
Int
is lost butString
remains.The text was updated successfully, but these errors were encountered: