API Katalon : org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method

Hi, I am getting this issue when I try run Katalon API test with a Custom Keyword:

Test Cases/Workflow (WF)/Designer/GET Design FAILED.
Reason:
org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: jsonSchemaValidator.validator.verifyJsonSchema() is applicable for argument types: (groovy.json.internal.LazyMap) values: [[data:[[code:Test, rowVersion:null], [code:TEsting, rowVersion:null]], …]]
Possible solutions: verifyJsonSchema(java.lang.String)

This is the Custom Keyword which I got from


and I adapted to my needs

Custom Keyword:

class validator {
/** * Send request and verify status code
* @param stringJson Json to validate
* @param stringSchema validation schema
*/
@Keyword
def verifyJsonSchema(String stringJson) {
Schema schema = SchemaLoader.load(“Schemas/Workflow/GET_Designer.json”)
try {
schema.validate(new JSONObject(stringJson))
KeywordUtil.markPassed(“Valid schema”)
} catch (ValidationException e) {
StringBuffer outmessage = new StringBuffer()
outmessage << e.getMessage() << “\n”
e.getAllMessages().each { msg -> outmessage << “$msg \n” }
KeywordUtil.markFailed(outmessage as String)
}
}
}

An this is the Test case:

//parse text json
response = CustomKeywords.‘com.response.parseResponse.responseParser’(response)

WS.comment(“Validate response schema”)
CustomKeywords.‘jsonSchemaValidator.validator.verifyJsonSchema’(response)

Any idea to resolve this, please?

Hello,
it’s allready written there:

Possible solutions: verifyJsonSchema(java.lang.String)
so, try instead of
CustomKeywords.‘jsonSchemaValidator.validator.verifyJsonSchema’(response)
where response is already parsed, use unparsed - raw response