-
Notifications
You must be signed in to change notification settings - Fork 6k
/
model_variables.mustache
91 lines (91 loc) · 2.14 KB
/
model_variables.mustache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/**
{{#description}}
* {{description}}
*
{{/description}}
* @var {{{vendorExtensions.x-commentType}}}{{^required}}|null{{/required}}
* @SerializedName("{{baseName}}")
{{#required}}
* @Assert\NotNull()
{{/required}}
{{#isEnum}}
{{#isContainer}}
* @Assert\All({
{{#items}}
* @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} })
{{/items}}
* })
{{/isContainer}}
{{^isContainer}}
* @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} })
{{/isContainer}}
{{/isEnum}}
{{#isContainer}}
* @Assert\All({
{{#items}}
* @Assert\Type("{{datatype}}")
{{/items}}
* })
{{#items}}
* @Type("array<{{datatype}}>")
{{/items}}
{{/isContainer}}
{{^isContainer}}
{{#isDate}}
* @Assert\Date()
* @Type("DateTime")
{{/isDate}}
{{#isDateTime}}
* @Assert\DateTime()
* @Type("DateTime")
{{/isDateTime}}
{{^isDate}}
{{^isDateTime}}
* @Assert\Type("{{datatype}}")
* @Type("{{datatype}}")
{{/isDateTime}}
{{/isDate}}
{{/isContainer}}
{{#hasValidation}}
{{#maxLength}}
* @Assert\Length(
* max = {{maxLength}}
* )
{{/maxLength}}
{{#minLength}}
* @Assert\Length(
* min = {{minLength}}
* )
{{/minLength}}
{{#minimum}}
{{#exclusiveMinimum}}
* @Assert\GreaterThan({{minimum}})
{{/exclusiveMinimum}}
{{^exclusiveMinimum}}
* @Assert\GreaterThanOrEqual({{minimum}})
{{/exclusiveMinimum}}
{{/minimum}}
{{#maximum}}
{{#exclusiveMaximum}}
* @Assert\LessThan({{maximum}})
{{/exclusiveMaximum}}
{{^exclusiveMaximum}}
* @Assert\LessThanOrEqual({{maximum}})
{{/exclusiveMaximum}}
{{/maximum}}
{{#pattern}}
* @Assert\Regex("/{{pattern}}/")
{{/pattern}}
{{#maxItems}}
* @Assert\Count(
* max = {{maxItems}}
* )
{{/maxItems}}
{{#minItems}}
* @Assert\Count(
* min = {{minItems}}
* )
{{/minItems}}
{{/hasValidation}}
*/
protected ${{name}};