Commit 8dc2584
authored
Fix field order in yaml generated OAS file (#3084)
Today, the field order in swagger.json files is consistent with
the actual order of fields in the .proto messages.
(i.e. not by protobuf index/tag and not alphabetically sorted, but
actually in the same order inside the protobuf)
However, in swagger.yaml files the order becomes alphabetical due to
automatic map[string]interface{} ordering in yaml marshaling.
This gives less control over generated documentation (Redoc) from
those yaml files.
This commit uses yaml.Node introduces in yaml.v3 to keep the same
field order in yaml generated files as well.1 parent 7542c08 commit 8dc2584
1 file changed
+17
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
266 | 266 | | |
267 | | - | |
268 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
269 | 280 | | |
270 | 281 | | |
271 | 282 | | |
| |||
0 commit comments