I have been trying to generate Java spring code like the following.
@RequestMapping(method=RequestMethod.DELETE, value="/message/{id}")
public void reject(@PathVariable final Long id) {
return;
}
I have provided the following code in the xtend file.
members += event.toMethod(event.action.name, typeRef(void)) [
var dataType = map.get(method.action.name)
parameters += event.toParameter(method.type.parameter.name, dataType.javaType) => [
annotations += annotationRef("org.springframework.web.bind.annotation.PathVariable");
]
annotations += annotationRef("org.springframework.web.bind.annotation.RequestMapping", "method=RequestMethod.DELETE", "/message/{id}");
body = '''
return;
'''
]
and the output I am getting is
@RequestMapping({ "method=RequestMethod.DELETE", "/message/{id}" })
public void reject(@PathVariable final Long id) {
return;
}
I am confused how to provide the xtend code so that I could get the RequestMapping format as @RequestMapping(method=RequestMethod.DELETE, value="/message/{id}")