I've added the RestApiErrors annotation to the show method as described in the doc but I receive an exception:
groovy.lang.MissingMethodException: No signature of method: static org.jsondoc.core.pojo.ApiErrorDoc.buildFromAnnotation() is applicable for argument types: (com.sun.proxy.$Proxy39) values: [@org.restapidoc.annotation.RestApiErrors(apierrors=[@org.restapidoc.annotation.RestApiError(description=The book was not found!, code=404)])]
Possible solutions: buildFromAnnotation(org.jsondoc.core.annotation.ApiErrors)
| Error groovy.lang.MissingMethodException: No signature of method: static org.jsondoc.core.pojo.ApiErrorDoc.buildFromAnnotation() is applicable for argument types: (com.sun.proxy.$Proxy39) values: [@org.restapidoc.annotation.RestApiErrors(apierrors=[@org.restapidoc.annotation.RestApiError(description=The book was not found!, code=404)])]
Possible solutions: buildFromAnnotation(org.jsondoc.core.annotation.ApiErrors)
| Error at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1374)
| Error at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1360)
| Error at groovy.lang.ExpandoMetaClass.invokeStaticMethod(ExpandoMetaClass.java:1123)
| Error at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:50)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
| Error at org.restapidoc.utils.JSONDocUtilsLight.getApiMethodDocs(JSONDocUtilsLight.groovy:238)
| Error at org.restapidoc.utils.JSONDocUtilsLight.this$3$getApiMethodDocs(JSONDocUtilsLight.groovy)
| Error at org.restapidoc.utils.JSONDocUtilsLight$this$3$getApiMethodDocs$1.callCurrent(Unknown Source)
Following is the annotation I've added:
@RestApiMethod(description="Get the book")
@RestApiParams(params=[
@RestApiParam(name="id", type="long", paramType = RestApiParamType.PATH, description = "The id")
])
@RestApiErrors(apierrors=[
@RestApiError(code="404",description="The book was not found!")
])
def show() {
respond queryForResource(params.id)
}
I've added the RestApiErrors annotation to the show method as described in the doc but I receive an exception:
Following is the annotation I've added: