Skip to content

@ApiModelProperty(dataType='xx') not handled within ModelPropertyParser #334

Closed
@andyoll

Description

@andyoll

In version 1.2.5 it was possible to annotate a case class as:

case class User(@(ApiProperty @field)(notes="nullable", dataType="long", required=false) id: Option[Long] = None, userName: String)

The dataType attribute would be processed correctly, and Option[Long] would not be described in Swagger doco as 'Object'. This seemed like a reasonable work-around for describing Option[xx] dataTypes.

In 1.3 I've migrated to:

case class User(@(ApiModelProperty @field)(required = false, value = "Id of the user record", dataType = "Long") id: Option[Long] = None, userName: String)

But now dataType has no effect. The resulting JSON for field id:

id: {
    "$ref": "Object",
    "description": "Id of the user record"
}

Although I can see that ModelPropertyParser$.processAnnotations does extract dataType value and return it, this value is never used in ModelPropertyParser$.parsePropertyAnnotations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions