@@ -70,19 +70,19 @@ The difficulty is that if you attempt to do this:
7070{
7171 "type" : " object" ,
7272 "allOf" : [
73- {"$ref" : " #/definitions/foo" },
74- {"$ref" : " #/definitions/bar" }
73+ { "$ref" : " #/definitions/foo" },
74+ { "$ref" : " #/definitions/bar" }
7575 ],
7676 "definitions" : {
7777 "foo" : {
7878 "properties" : {
79- "foo" : {"type" : " string" }
79+ "foo" : { "type" : " string" }
8080 },
8181 "additionalProperties" : false
8282 },
8383 "bar" : {
8484 "properties" : {
85- "bar" : {"type" : " number" }
85+ "bar" : { "type" : " number" }
8686 },
8787 "additionalProperties" : false
8888 }
@@ -100,30 +100,28 @@ A workaround is available with the new `"propertyNames"` keyword:
100100{
101101 "type" : " object" ,
102102 "allOf" : [
103- {"$ref" : " #/definitions/foo" },
104- {"$ref" : " #/definitions/bar" }
105- ],
106- "anyOf" : [
107- {"$ref" : " #/definitions/fooNames" },
108- {"$ref" : " #/definitions/barNames" }
103+ { "$ref" : " #/definitions/foo" },
104+ { "$ref" : " #/definitions/bar" }
109105 ],
106+ "propertyNames" : {
107+ "anyOf" : [
108+ { "$ref" : " #/definitions/fooNames" },
109+ { "$ref" : " #/definitions/barNames" }
110+ ]
111+ },
110112 "definitions" : {
111113 "foo" : {
112114 "properties" : {
113- "foo" : {"type" : " string" }
115+ "foo" : { "type" : " string" }
114116 }
115117 },
116- "fooNames" : {
117- "propertyNames" : {"enum" : [" foo" ]}
118- },
118+ "fooNames" : { "enum" : [" foo" ] },
119119 "bar" : {
120120 "properties" : {
121- "bar" : {"type" : " number" }
121+ "bar" : { "type" : " number" }
122122 }
123123 },
124- "barNames" : {
125- "propertyNames" : {"enum" : [" bar" ]}
126- }
124+ "barNames" : { "enum" : [" bar" ] }
127125 }
128126}
129127```
0 commit comments