@ApiModelProperty notes - not in 1.2 spec, and ignored by swagger-ui

994 views
Skip to first unread message

Marek Żebrowski

unread,
Apr 23, 2014, 6:27:43 AM4/23/14
to swagger-sw...@googlegroups.com
Hi.
 I noticed that in @ApiModelProperty interface there is a notes  
 /** long description of the property */
  String notes() default "";
This property is not present in swagger-spec 1.2
says nothing about it
Is notes going to be a part of a future swagger spec, not just implemented yet in ui? I'd like to have more verbose description of some model properties, notes seems to be right place to do it, but I don't know if it's going to be supported in swagger.


Ron

unread,
Apr 27, 2014, 7:03:48 AM4/27/14
to swagger-sw...@googlegroups.com
The notes field is part of the spec. It translates to the description field in the model property.
Take a look at the following link: https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#529-property-object


--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

alex....@fieldlocate.com

unread,
Jun 2, 2014, 2:30:55 PM6/2/14
to swagger-sw...@googlegroups.com
Sorry to dig this up, but according to what I'm experiencing, this isn't correct.

The value() property of the annotation is what translates to the description field, while notes() is ignored.  I was able to confirm this by inspecting the generated JSON for one of my models; even with notes() being the only thing defined in my @ApiModelProperty annotation, description is empty.  With notes() and value(), description is defined as value().

I'd like to pose the same question that Marek did, but I know you guys are in the process of defining the newest spec right now, but I figured this information would be relevant.

I'd also like to ask for maybe a point in the right direction so I can add the notes field to the annotation parsing myself for my project, if at all possible.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


Confidentiality Notice:  - This message and any attached files may contain information that is confidential and/or subject of legal privilege intended only for the use by the intended recipient. If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, be advised that you have received this message in error and that any dissemination, copying or use of this message or attachment is strictly forbidden, as is the disclosure of the information therein. If you have received this message in error please notify the sender immediately and delete the message.

Ron

unread,
Jun 10, 2014, 7:52:39 AM6/10/14
to swagger-sw...@googlegroups.com
Hi Alex,

Thank you for digging into this.

You're absolutely right. I've dug into it a bit more, and you are correct with what you said.
The value() translates to the description, and the notes() actually does translate to notes().
However, since there's no "notes" field for model properties (as you can see from the spec), it is being ignored.

This may be some remnant from an old spec version or just an honest mistake.

If you want to suggest adding such a field, feel free to join the Swagger 2.0 spec discussion (swagger.wordnik.com) or open an issue on the swagger-spec repo.


To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages