@@ -70,19 +70,19 @@ The difficulty is that if you attempt to do this:
70
70
{
71
71
"type" : " object" ,
72
72
"allOf" : [
73
- {"$ref" : " #/definitions/foo" },
74
- {"$ref" : " #/definitions/bar" }
73
+ { "$ref" : " #/definitions/foo" },
74
+ { "$ref" : " #/definitions/bar" }
75
75
],
76
76
"definitions" : {
77
77
"foo" : {
78
78
"properties" : {
79
- "foo" : {"type" : " string" }
79
+ "foo" : { "type" : " string" }
80
80
},
81
81
"additionalProperties" : false
82
82
},
83
83
"bar" : {
84
84
"properties" : {
85
- "bar" : {"type" : " number" }
85
+ "bar" : { "type" : " number" }
86
86
},
87
87
"additionalProperties" : false
88
88
}
@@ -100,30 +100,28 @@ A workaround is available with the new `"propertyNames"` keyword:
100
100
{
101
101
"type" : " object" ,
102
102
"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" }
109
105
],
106
+ "propertyNames" : {
107
+ "anyOf" : [
108
+ { "$ref" : " #/definitions/fooNames" },
109
+ { "$ref" : " #/definitions/barNames" }
110
+ ]
111
+ },
110
112
"definitions" : {
111
113
"foo" : {
112
114
"properties" : {
113
- "foo" : {"type" : " string" }
115
+ "foo" : { "type" : " string" }
114
116
}
115
117
},
116
- "fooNames" : {
117
- "propertyNames" : {"enum" : [" foo" ]}
118
- },
118
+ "fooNames" : { "enum" : [" foo" ] },
119
119
"bar" : {
120
120
"properties" : {
121
- "bar" : {"type" : " number" }
121
+ "bar" : { "type" : " number" }
122
122
}
123
123
},
124
- "barNames" : {
125
- "propertyNames" : {"enum" : [" bar" ]}
126
- }
124
+ "barNames" : { "enum" : [" bar" ] }
127
125
}
128
126
}
129
127
```
0 commit comments