Raml 1.0 validation annotations


#1

coming from Raml 0.8 where annotations were generated on the generated pojos based on jsr303. I am unable to get this working via the cli tool. passing -g jsr303 does not create the annotations. what am i missing here?

pojos in 0.8 generated with the following, looking for the same with 1.0 and cannot seem to get it working

@JsonProperty("createdByUserId")
@Pattern(regexp = "^[a-f0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")
@NotNull
private String createdByUserId;

#2

@Z_Shall: which tool is that? From your example, I am guessing raml-for-jax-rs, ramltojaxrs to be more precise, is that right? if so, can you share the version and the RAML you are using to generate those pojos?


#3

thanks for the reply,
i got this working, yes, it was with the raml for jaxrs the missing piece of the puzzle was setting
config.put("isIncludeJsr303Annotations", "true");
and passing the config as the json mapper configuration