@@ -7,14 +7,25 @@ testRule('xgen-IPA-123-enum-values-must-be-upper-snake-case', [
77 document : {
88 components : {
99 schemas : {
10- SchemaName : {
10+ SchemaName1 : {
1111 properties : {
1212 exampleProperty : {
1313 enum : [ 'EXAMPLE_A' , 'EXAMPLE_B' ] ,
1414 type : 'string' ,
1515 } ,
1616 } ,
1717 } ,
18+ SchemaName2 : {
19+ properties : {
20+ exampleProperty : {
21+ type : 'array' ,
22+ items : {
23+ type : 'string' ,
24+ enum : [ 'EXAMPLE_A' , 'EXAMPLE_B' ] ,
25+ }
26+ } ,
27+ } ,
28+ } ,
1829 } ,
1930 } ,
2031 } ,
@@ -36,6 +47,20 @@ testRule('xgen-IPA-123-enum-values-must-be-upper-snake-case', [
3647 } ,
3748 } ,
3849 } ,
50+ SchemaName2 : {
51+ properties : {
52+ exampleProperty : {
53+ type : 'array' ,
54+ items : {
55+ type : 'string' ,
56+ enum : [ 'exampleA' , 'exampleB' ] ,
57+ } ,
58+ 'x-xgen-IPA-exception' : {
59+ 'xgen-IPA-123-enum-values-must-be-upper-snake-case' : 'reason' ,
60+ } ,
61+ } ,
62+ } ,
63+ } ,
3964 } ,
4065 } ,
4166 } ,
@@ -54,6 +79,17 @@ testRule('xgen-IPA-123-enum-values-must-be-upper-snake-case', [
5479 } ,
5580 } ,
5681 } ,
82+ SchemaName2 : {
83+ properties : {
84+ exampleProperty : {
85+ type : 'array' ,
86+ items : {
87+ type : 'string' ,
88+ enum : [ 'exampleA' , 'exampleB' ] ,
89+ } ,
90+ } ,
91+ } ,
92+ } ,
5793 } ,
5894 } ,
5995 } ,
@@ -70,6 +106,18 @@ testRule('xgen-IPA-123-enum-values-must-be-upper-snake-case', [
70106 path : [ 'components' , 'schemas' , 'SchemaName' , 'properties' , 'exampleProperty' ] ,
71107 severity : DiagnosticSeverity . Warning ,
72108 } ,
109+ {
110+ code : 'xgen-IPA-123-enum-values-must-be-upper-snake-case' ,
111+ message : 'enum[0]:exampleA enum value must be UPPER_SNAKE_CASE. http://go/ipa/123' ,
112+ path : [ 'components' , 'schemas' , 'SchemaName2' , 'properties' , 'exampleProperty' ] ,
113+ severity : DiagnosticSeverity . Warning ,
114+ } ,
115+ {
116+ code : 'xgen-IPA-123-enum-values-must-be-upper-snake-case' ,
117+ message : 'enum[1]:exampleB enum value must be UPPER_SNAKE_CASE. http://go/ipa/123' ,
118+ path : [ 'components' , 'schemas' , 'SchemaName2' , 'properties' , 'exampleProperty' ] ,
119+ severity : DiagnosticSeverity . Warning ,
120+ } ,
73121 ] ,
74122 } ,
75123 {
0 commit comments