Commit a16fcae
fix(openapi/upload): better handling for mismatching files/slugs (#1345)
| 🚥 Resolves CX-2293 |
| :------------------- |
## 🧰 Changes
we previously had a restriction in place where you could not upload a
JSON file (e.g., `petstore.json`) to a slug with a YAML file extension
(e.g., `--slug file.yml`). the reasoning was that we didn't want to
create any unexpected client-side behaviors and we wanted to prioritize
explicitness.
however, we've been getting feedback that it's misleading how `rdme`
directs customers towards certain slugs, only to see an error that they
can't use that slug due to this file extension restriction.
this PR lifts that restriction and makes it so `rdme` will convert a
JSON file to YAML prior to uploading if the slug has a YAML file
extension (or vice versa). it will also emit a warning to the user when
this happens!
## 🧬 QA & Testing
added a bunch of tests for this behavior!
---------
Co-authored-by: Emily Kuo <58803587+emilyskuo@users.noreply.github.com>1 parent 70ae37e commit a16fcae
File tree
3 files changed
+261
-56
lines changed- __tests__/commands/openapi
- __snapshots__
- src/commands/openapi
3 files changed
+261
-56
lines changedLines changed: 31 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
184 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
185 | 214 | | |
186 | | - | |
187 | 215 | | |
188 | 216 | | |
189 | 217 | | |
| |||
0 commit comments