Skip to content

jooby-apt: kotlin: should generates a code with !! null operator for nullable types #3507

@jonaskahn

Description

@jonaskahn

I will go straight to the problem. I make a controller with return type is nullable, but it will make generate source error because the generate source somehow think return type is always not null

  • Source:
    @POST("/secure/org/info")
    fun info(request: OrgInfoRequest): OrgDto? {
        BeanValidator.validate(request)
        return orgService.info(request)
    }
  • Generated source
    fun info(ctx: io.jooby.Context): io.github.jonaskahn.services.org.dto.OrgDto {
      val c = this.factory.apply(ctx)
      return c.info(ctx.body(io.github.jonaskahn.controllers.org.OrgInfoRequest::class.java))
    }

I think it could be a bug?

bug-report

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions