Commit affdd7d
Corrected schema generation for
The previous version of the `TypeFactory` generated following **WRONG** definitions:
* `null|T[]` as `{"type": array, "items": {"type": "T"}}`
* `?T[]` as `{"type": array, "items": {"type": "T"}}`
* `array<string, T> as `{"type": array, "items": {"type": "T"}}`
* `object` without explicit schema definition as `{"type": "string"}`
* `?T` as `{"type": T}`
The new definitions instead do fix this by mapping:
* `array<string, T>` as `{"type": "object", "additionalProperties": {"type": "T"}}`
* `array<string, ?T> as `{"type": object, "additionalProperties": {"type": ["T", "null"]}}`
* `null|array<string, T>` as `{"type": ["object", "null"], "additionalProperties": {"type": "T"}}`
* `array<int, T>` as `{"type": "array", "items": {"type": "T"}}` (not very precise, but list support is not yet in symfony)
* `object` without explicit schema definition as `{"type": "object"}`
* `?T[]` as `{"type": "array", "items": {"type": ["T", "null"]}}`
* `null|T[]` as `{"type": ["array", "null"], "items": {"type": "T"}}`array<string, T>, object, ?array, ?object and ?type
1 parent 94be0cc commit affdd7d
1 file changed
+73
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
59 | 77 | | |
60 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
61 | 87 | | |
62 | 88 | | |
63 | 89 | | |
| |||
78 | 104 | | |
79 | 105 | | |
80 | 106 | | |
81 | | - | |
| 107 | + | |
82 | 108 | | |
83 | 109 | | |
84 | 110 | | |
| |||
102 | 128 | | |
103 | 129 | | |
104 | 130 | | |
105 | | - | |
| 131 | + | |
106 | 132 | | |
107 | 133 | | |
108 | 134 | | |
| |||
125 | 151 | | |
126 | 152 | | |
127 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
128 | 193 | | |
0 commit comments