Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Option[T] not entirely supported #180

@gaeljw

Description

@gaeljw

Hi,

Having an implicit body parameter which definition looks like this:

case class SomeDTO(
  name: Option[String],
  aLong: Option[Long],
  aFloat: Option[Float],
  aBoolean: Option[Boolean]
)

And declaration:

@ApiImplicitParams(Array(
    new ApiImplicitParam(value = "xxx", paramType = "body", dataType = "dto.SomeDTO", required = true)
  ))

Result in the following swagger.json file:

"SomeDTO" : {
      "type" : "object",
      "properties" : {
        "name" : {
          "type" : "string"
        },
        "aLong" : {
          "type" : "object"
        },
        "aFloat" : {
          "type" : "object"
        },
        "aBoolean" : {
          "type" : "object"
        }
      }
    },

That is, Option[String] is correctly mapped to string but other Option[Long], Option[Float] and Option[Boolean] are mapped to object which is not correct. They should be mapped to number and boolean.

And then, in the UI, examples for this type are not well presented.

NB: I haven't tested if it's specific to implicit and/or body params or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions