loic911 / Rest-api-doc

MIT License
21 stars 32 forks source link

Error in declaring the @RestApiHeaders #11

Closed sunilinteti closed 9 years ago

sunilinteti commented 10 years ago

I am using this plugin developed by you. When I try to run the grails rest-api-doc I get the following exception spcified in the Error log. How can I solve this ?

I have annotated my grails controller method like this

@RestApiMethod(description="Get a role") @RestApiHeaders(headers=[@RestApiHeader(name="X-Auth-Token", description="Authentication token")]) @RestApiParams(params=[ @RestApiParam(name="id", type="String", paramType = RestApiParamType.PATH, description = "The employee id"), @RestApiParam(name="roletype", type="String", paramType = RestApiParamType.PATH, description = "The role type"), @RestApiParam(name="roleid", type="String", paramType = RestApiParamType.PATH, description = "The role id"), @RestApiParam(name="query", type="String", paramType = RestApiParamType.PATH, description = "The role filter by", required=false), @RestApiParam(name="validity", type="String", paramType = RestApiParamType.PATH, description = "The role filter by", required=false), @RestApiParam(name="effective-date", type="String", paramType = RestApiParamType.QUERY, description = "Fetch role from effective date ", required=false), ])

def roles() { //method }

The problem lies in the declaration of @RestApiHeaders(headers=[@RestApiHeader(name="X-Auth-Token", description="Authentication token")])

Is this wrong ? Your help is valuable. Awaiting your reply

Error log

Start build JSON doc... groovy.lang.MissingMethodException: No signature of method: static org.restapidoc.pojo.RestApiMethodDoc.buildFromAnnotation() is applicable for argument types: (com.sun.proxy.$Proxy23) values: [@org.restapidoc.annotation.RestApiHeaders(headers=[@org.restapidoc.annotation.RestApiHeader(description=Authentication token, name=X-Auth-Token)])] Possible solutions: buildFromAnnotation(org.jsondoc.core.annotation.ApiMethod), buildFromAnnotation(org.restapidoc.annotation.RestApiMethod, java.lang.String, java.lang.String, java.lang.String) Error | groovy.lang.MissingMethodException: No signature of method: static org.restapidoc.pojo.RestApiMethodDoc.buildFromAnnotation() is applicable for argument types: (com.sun.proxy.$Proxy23) values: [@org.restapidoc.annotation.RestApiHeaders(headers=[@org.restapidoc.annotation.RestApiHeader(description=Authentication token, name=X-Auth-Token)])] Possible solutions: buildFromAnnotation(org.jsondoc.core.annotation.ApiMethod), buildFromAnnotation(org.restapidoc.annotation.RestApiMethod, java.lang.String, java.lang.String, java.lang.String) Error |

dbk138 commented 9 years ago

Could you please push this to release 0.4? I am still receiving errors in the latest build due to this. Thank you!

loic911 commented 9 years ago

Sorry I forgot that. I've quickly done the fix in 0.4.1.