File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed
src/core/plugins/oas3/components Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ const RequestBody = ({
6767
6868 const mediaTypeValue = requestBodyContent . get ( contentType , OrderedMap ( ) )
6969 const schemaForMediaType = mediaTypeValue . get ( "schema" , OrderedMap ( ) )
70- const examplesForMediaType = mediaTypeValue . get ( "examples" , OrderedMap ( ) )
70+ const examplesForMediaType = mediaTypeValue . get ( "examples" , null )
7171
7272 const handleExamplesSelect = ( key /*, { isSyntheticChange } */ ) => {
7373 updateActiveExamplesKey ( key )
Original file line number Diff line number Diff line change 1+ openapi : 3.0.2
2+ info :
3+ title : test
4+ version : 1.0.0
5+ paths :
6+ /foo :
7+ post :
8+ requestBody :
9+ required : true
10+ content :
11+ application/json :
12+ schema :
13+ $ref : ' #/components/schemas/Foo'
14+ responses :
15+ 201 :
16+ description : Created
17+
18+ components :
19+ schemas :
20+ Foo :
21+ type : object
22+ properties :
23+ foo :
24+ type : string
25+ example : bar
Original file line number Diff line number Diff line change 1+ // http://github.com/swagger-api/swagger-ui/issues/5455
2+
3+ describe ( "#5455: Request bodies w/o `examples` should not render a dropdown" , ( ) => {
4+ it ( "should not render a <select> element" , ( ) => {
5+ cy . visit ( "/?url=/documents/bugs/5455.yaml" )
6+ . get ( "#operations-default-post_foo" )
7+ . click ( )
8+ . get ( ".opblock-section-request-body > .opblock-description-wrapper" )
9+ . should ( "not.have.descendants" , "select" )
10+ } )
11+ } )
You can’t perform that action at this time.
0 commit comments