Swagger-core: @ApiModelProperty in Annotations-2.X?

Created on 2 Nov 2017  路  3Comments  路  Source: swagger-api/swagger-core

Looking at the docs for Annotations 2.X, there's a reference to \@ ApiModelProperty. However, this annotation doesn't exist in the source. Is the documentation incorrect? Or is the source incorrect? In which case, was it removed intentionally, or is it planned to be added later?

3.0 spec support

Most helpful comment

You both are right. The ApiModelProperty doesn't exist in the new version. Everything related with the models is now handled with the @Schema annotation.
Thanks a lot for this observation!
We updated the wiki with this:

And/Or a schema property:

@Schema(description = "pet status in the store", allowableValues = {"available","pending","sold"}) public String getStatus() { return status; }

All 3 comments

Ah, I see it now. Most of what used to be under ApiModelProperty now lives under Schema.

What does that mean, exactly? The docs shows this:

@ApiModelProperty(description = "pet status in the store", allowableValues =  {"available","pending","sold"})
  public String getStatus() {
    return status;
  }

But that annotation doesn't exist in 2.0.0-rc2. How should I document fields in my class?

You both are right. The ApiModelProperty doesn't exist in the new version. Everything related with the models is now handled with the @Schema annotation.
Thanks a lot for this observation!
We updated the wiki with this:

And/Or a schema property:

@Schema(description = "pet status in the store", allowableValues = {"available","pending","sold"}) public String getStatus() { return status; }

Was this page helpful?
0 / 5 - 0 ratings