File tree Expand file tree Collapse file tree 3 files changed +31
-4
lines changed Expand file tree Collapse file tree 3 files changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -778,15 +778,32 @@ impl<Context: ServerContext> ApiDescription<Context> {
778778 } else {
779779 // If no schema was specified, the response is hand-rolled. In
780780 // this case we'll fall back to the default response type which
781- // we assume to be inclusive of errors.
781+ // we assume to be inclusive of errors. The media type and
782+ // and schema will similarly be maximally permissive.
783+ let mut content = indexmap:: IndexMap :: new ( ) ;
784+ content. insert (
785+ "*/*" . to_string ( ) ,
786+ openapiv3:: MediaType {
787+ schema : Some ( openapiv3:: ReferenceOr :: Item (
788+ openapiv3:: Schema {
789+ schema_data : openapiv3:: SchemaData :: default ( ) ,
790+ schema_kind : openapiv3:: SchemaKind :: Any (
791+ openapiv3:: AnySchema :: default ( ) ,
792+ ) ,
793+ } ,
794+ ) ) ,
795+ ..Default :: default ( )
796+ } ,
797+ ) ;
782798 operation. responses . default =
783799 Some ( openapiv3:: ReferenceOr :: Item ( openapiv3:: Response {
784800 // TODO: perhaps we should require even free-form
785801 // responses to have a description since it's required
786802 // by OpenAPI.
787803 description : "" . to_string ( ) ,
804+ content,
788805 ..Default :: default ( )
789- } ) )
806+ } ) ) ;
790807 }
791808
792809 // Drop in the operation.
Original file line number Diff line number Diff line change 485485 "operationId" : " handler16" ,
486486 "responses" : {
487487 "default" : {
488- "description" : " "
488+ "description" : " " ,
489+ "content" : {
490+ "*/*" : {
491+ "schema" : {}
492+ }
493+ }
489494 }
490495 }
491496 }
Original file line number Diff line number Diff line change 493493 "operationId" : " handler16" ,
494494 "responses" : {
495495 "default" : {
496- "description" : " "
496+ "description" : " " ,
497+ "content" : {
498+ "*/*" : {
499+ "schema" : {}
500+ }
501+ }
497502 }
498503 }
499504 }
You can’t perform that action at this time.
0 commit comments