Skip to content

@Description annotation doesn't work #123

@greekZorba

Description

@greekZorba

I am trying to use @Description to my schema model.

my version is 0.3-beta.2

But nothing happen to my schema model.

Am I using @Description annotation incorrectly? Or @Description is working improperly?

this is my code as shown below.

can I get any advice?

  fun NormalOpenAPIRoute.regionSpec() {
  
          route("/api/regions") {
              get<Unit, RegionResponse>(
                  info("show regions")
              ) {
                  respond(RegionResponse.of("seoul", 1, "seoul city"))
              }        
  }
      @Response("Region")
      data class RegionResponse(
          @Description("city") val sido: String,
          @Description("region id") val regionId: Int,
          @Description("region name") val region: String
      ) : Serializable {
          companion object {
              fun of(sido: String, regionId: Int, region: String) =
                  RegionResponse(sido = sido, regionId = regionId, region = region)
          }
      }
    "components" : {
        "schemas" : {
          "RegionResponse" : {
            "nullable" : false,
            "properties" : {
              "region" : {
                "nullable" : false,
                "type" : "string"
              },
              "regionId" : {
                "format" : "int32",
                "nullable" : false,
                "type" : "integer"
              },
              "sido" : {
                "nullable" : false,
                "type" : "string"
              }
            },
            "required" : [ "region", "regionId", "sido" ],
            "type" : "object"
          }
       }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions