@@ -382,23 +382,9 @@ impl ParameterDataExt for openapiv3::ParameterData {
382
382
383
383
trait ExtractJsonMediaType {
384
384
fn is_binary ( & self ) -> Result < bool > ;
385
- fn content_json ( & self ) -> Result < openapiv3:: MediaType > ;
386
385
}
387
386
388
387
impl ExtractJsonMediaType for openapiv3:: Response {
389
- fn content_json ( & self ) -> Result < openapiv3:: MediaType > {
390
- // We do not need to check the length of the content because there might be
391
- // more than one. For example, if xml or some other format is also defined.
392
- if let Some ( mt) = self . content . get ( "application/json" ) {
393
- Ok ( mt. clone ( ) )
394
- } else {
395
- bail ! (
396
- "could not find application/json, only found {}" ,
397
- self . content. keys( ) . next( ) . unwrap( )
398
- ) ;
399
- }
400
- }
401
-
402
388
fn is_binary ( & self ) -> Result < bool > {
403
389
if self . content . is_empty ( ) {
404
390
/*
@@ -460,19 +446,6 @@ impl ExtractJsonMediaType for openapiv3::Response {
460
446
}
461
447
462
448
impl ExtractJsonMediaType for openapiv3:: RequestBody {
463
- fn content_json ( & self ) -> Result < openapiv3:: MediaType > {
464
- // We do not need to check the length of the content because there might be
465
- // more than one. For example, if xml or some other format is also defined.
466
- if let Some ( mt) = self . content . get ( "application/json" ) {
467
- Ok ( mt. clone ( ) )
468
- } else {
469
- bail ! (
470
- "could not find application/json, only found {}" ,
471
- self . content. keys( ) . next( ) . unwrap( )
472
- ) ;
473
- }
474
- }
475
-
476
449
fn is_binary ( & self ) -> Result < bool > {
477
450
if self . content . is_empty ( ) {
478
451
/*
0 commit comments