Examples rendering for 'multipart/form-data' and 'application/x-www-form-urlencoded'#1315
Conversation
PR Review — "Examples rendering for
|
| # | Severity | Issue |
|---|---|---|
| 3 | Bug | example.value[schemaKey] should be example[schemaKey] |
| 4 | Design | Tab switching doesn't re-sync Redux state (last-mounted tab wins) |
| 1 | Minor | useEffect([]) missing eslint-disable comment |
| 2 | Minor | Object fields without examples now always render LiveApp (undocumented change) |
| 5 | Informational | application/x-www-form-urlencoded is also affected, not just multipart/form-data |
The dead-code removal in FileArrayFormBodyItem is a nice cleanup. Items 3 and 4 should be resolved before merging.
|
Hi @sserrata, could you please re-check point 4 regarding design and Redux synchronization? I see that the useEffect part is called every time a tab is selected, so sync is applied. Here is a screen recording: I agree with the rest comments. |
|
Fixed points 1 and 3. Comments on other: |
|
Thanks @v50553490-cyber, my apologies for the long delay in responding...everything looks good except for the following: value.value[schemaKey] is missing a null guard If an ExampleObject has no value property (it's optional per the OpenAPI spec), this will throw at runtime. Can add a guard like this: Same for example[schemaKey] on the single-example tab — safe since example is a raw object, but schemaKey may not exist in it. Returning |
|
Visit the preview URL for this PR (updated for commit fa2dc6a): https://docusaurus-openapi-36b86--pr1315-wpyjbe90.web.app (expires Wed, 29 Apr 2026 16:28:45 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
|
Hi @sserrata, I've added a null guard for the |
|
Thanks @v50553490-cyber — the null guard for All items addressed — merging now. |
Description
Motivation and Context
The commit makes it possible to render named or unnamed examples using SchemaTabs for 'multipart/form-data' + 'application/x-www-form-urlencoded'.
How Has This Been Tested?
Screenshots (if appropriate)
Types of changes
Checklist