getting field names from @ApiModelProperty

30 views
Skip to first unread message

Robin Masters

unread,
Apr 22, 2015, 11:56:15 AM4/22/15
to swagger-sw...@googlegroups.com
Hello,
We're trying to use swagger, and its all working but we're noticing that the name of the field isn't showing up.  Is there a basic template setting to use to expose that automatically?  And if not what is the standard to do that?
We're getting all the below elements except the name which might not exist, but can't seem to get the field name automatically, before we start writing value="FieldName:productId - the product id" in the @ApiModelProperty, i thought i'd ask.  


<tr>
        <td>{{#name}}{{{name}}}{{/name}}{{^name}}-{{/name}}</td>  ///  <-- Something like this we're expecting maybe?
        <td>{{#linkType}}<a href="#{{linkType}}">{{type}}</a>{{/linkType}}{{^linkType}}{{type}}{{/linkType}}</td>
        <td>{{#required}}required{{/required}}{{^required}}optional{{/required}}</td>
        <td>{{#access}}{{{access}}}{{/access}}{{^access}}-{{/access}}</td>
        <td>{{#description}}{{{description}}}{{/description}}{{^description}}-{{/description}}</td>
        <td>{{#allowableValue}}{{.}}{{/allowableValue}}</td>
        <!--
        <td>{{#notes}}{{{notes}}}{{/notes}}{{^notes}}-{{/notes}}</td>
        -->
    </tr>

we're using the maven plugin.

My thought would be that a swagger implementation would do its best to get a field name and allow you to override that if need be.

Very new to understanding this.


Ron Ratovsky

unread,
Apr 30, 2015, 10:25:16 AM4/30/15
to swagger-sw...@googlegroups.com
Hi Robin,

Apologies for the delayed reply.

The swagger-maven-plugin is a community contribution and I'm not familiar with its ins-and-outs to be able to give you proper support.
I'd recommend opening an issue directly on the repository or possibly check for related issues there.


--
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.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------
Reply all
Reply to author
Forward
0 new messages