Commit 5272a7e
authored
feat(openapi/upload): docs + DX enhancements for slugs vs. legacy IDs (#1309)
## 🧰 Changes
folks have been a little confused with the slug vs. legacy id parameter
paradigm, so this PR enhances the DX and docs for `rdme openapi upload`
in a few ways:
- [x] expanded upon the whole legacy ID ➡️ slug change in the migration
guide
- [x] added a little bit of smarter DX for when a user passes in a
`--slug <some slug that looks eerily like a mongo object id>` (which is
a no-no since object IDs should be using `--legacy-id`):
- if a user passes an object ID and it matches one of the legacy IDs in
the API definitions list, it'll prompt the user before updating that API
definition, and emit a warning telling them what the correct slug should
be. if this is run in CI, it'll throw an error that tells them the
correct file name.
<img width="2906" height="219" alt="CleanShot 2025-07-17 at 17 28 43@2x"
src="https://github.com/user-attachments/assets/2bf7f7b2-7b27-4605-8bab-aa25f79d24cf"
/>
- if the object ID doesn't match anything, it'll proceed as normal but
emit a warning telling them to check out our migration guide, just in
case.
<img width="2512" height="196" alt="CleanShot 2025-07-17 at 17 31 55@2x"
src="https://github.com/user-attachments/assets/d505d174-1f65-43fb-a5ff-197db1c03ddd"
/>
- [x] if a user passes the `--legacy-id` flag and there aren't any
matches but there are legacy API definitions in the project, the error
message will suggest those
- [x] if a user passes the `--legacy-id` flag and there is a match, the
warning is now a bit more custom tailored and will inform them of what
the slug is and encourage them to use that instead
## 🧬 QA & Testing
wrote a bunch of tests for every permutation of this logic, and
confirmed it works against my lil clone of our internal handbook.1 parent 9eae363 commit 5272a7e
File tree
5 files changed
+288
-16
lines changed- __tests__/commands/openapi
- __snapshots__
- documentation
- commands
- src/commands/openapi
5 files changed
+288
-16
lines changedLines changed: 81 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
28 | 45 | | |
29 | 46 | | |
30 | 47 | | |
| |||
36 | 53 | | |
37 | 54 | | |
38 | 55 | | |
39 | | - | |
40 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
41 | 60 | | |
42 | 61 | | |
43 | 62 | | |
| |||
101 | 120 | | |
102 | 121 | | |
103 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
104 | 151 | | |
105 | 152 | | |
106 | 153 | | |
| |||
119 | 166 | | |
120 | 167 | | |
121 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
122 | 188 | | |
123 | 189 | | |
124 | 190 | | |
| |||
149 | 215 | | |
150 | 216 | | |
151 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
152 | 227 | | |
153 | 228 | | |
154 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
195 | 257 | | |
196 | 258 | | |
197 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
198 | 264 | | |
199 | 265 | | |
200 | 266 | | |
| 267 | + | |
| 268 | + | |
201 | 269 | | |
202 | 270 | | |
203 | 271 | | |
204 | 272 | | |
205 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
206 | 278 | | |
207 | 279 | | |
208 | 280 | | |
| 281 | + | |
| 282 | + | |
209 | 283 | | |
210 | 284 | | |
211 | 285 | | |
| |||
390 | 464 | | |
391 | 465 | | |
392 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
393 | 481 | | |
394 | 482 | | |
395 | 483 | | |
| |||
578 | 666 | | |
579 | 667 | | |
580 | 668 | | |
581 | | - | |
| 669 | + | |
582 | 670 | | |
583 | 671 | | |
584 | 672 | | |
| |||
591 | 679 | | |
592 | 680 | | |
593 | 681 | | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
594 | 718 | | |
595 | 719 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
| |||
0 commit comments