@@ -377,7 +377,7 @@ public static OpenApiParameter CreateTop(this ODataContext context, IEdmVocabula
377377 /// </summary>
378378 /// <param name="context">The OData context.</param>
379379 /// <param name="targetPath">The string representation of the Edm target path.</param>
380- /// <param name="document">The Open API document.</param>
380+ /// <param name="document">The Open API document to use to build references .</param>
381381 /// <returns></returns>
382382 public static OpenApiParameter CreateTop ( this ODataContext context , string targetPath , OpenApiDocument document )
383383 {
@@ -397,16 +397,18 @@ public static OpenApiParameter CreateTop(this ODataContext context, string targe
397397 /// </summary>
398398 /// <param name="context">The OData context.</param>
399399 /// <param name="target">The Edm annotation target.</param>
400+ /// <param name="document">The Open API document to use to build references.</param>
400401 /// <returns>The created <see cref="OpenApiParameter"/> or null.</returns>
401- public static OpenApiParameter CreateSkip ( this ODataContext context , IEdmVocabularyAnnotatable target )
402+ public static OpenApiParameter CreateSkip ( this ODataContext context , IEdmVocabularyAnnotatable target , OpenApiDocument document )
402403 {
403404 Utils . CheckArgumentNull ( context , nameof ( context ) ) ;
404405 Utils . CheckArgumentNull ( target , nameof ( target ) ) ;
406+ Utils . CheckArgumentNull ( document , nameof ( document ) ) ;
405407
406408 bool ? skip = context . Model . GetBoolean ( target , CapabilitiesConstants . SkipSupported ) ;
407409 if ( skip == null || skip . Value )
408410 {
409- return new OpenApiParameterReference ( "skip" , null ) ;
411+ return new OpenApiParameterReference ( "skip" , document ) ;
410412 }
411413
412414 return null ;
@@ -417,34 +419,38 @@ public static OpenApiParameter CreateSkip(this ODataContext context, IEdmVocabul
417419 /// </summary>
418420 /// <param name="context">The OData context.</param>
419421 /// <param name="targetPath">The string representation of the Edm target path.</param>
422+ /// <param name="document">The Open API document to use to build references.</param>
420423 /// <returns></returns>
421- public static OpenApiParameter CreateSkip ( this ODataContext context , string targetPath )
424+ public static OpenApiParameter CreateSkip ( this ODataContext context , string targetPath , OpenApiDocument document )
422425 {
423426 Utils . CheckArgumentNull ( context , nameof ( context ) ) ;
424427 Utils . CheckArgumentNull ( targetPath , nameof ( targetPath ) ) ;
428+ Utils . CheckArgumentNull ( document , nameof ( document ) ) ;
425429
426430 IEdmTargetPath target = context . Model . GetTargetPath ( targetPath ) ;
427431 if ( target == null )
428432 return null ;
429433
430- return context . CreateSkip ( target ) ;
434+ return context . CreateSkip ( target , document ) ;
431435 }
432436
433437 /// <summary>
434438 /// Create the $search parameter.
435439 /// </summary>
436440 /// <param name="context">The OData context.</param>
437441 /// <param name="target">The Edm annotation target.</param>
442+ /// <param name="document">The Open API document to use to build references.</param>
438443 /// <returns>The created <see cref="OpenApiParameter"/> or null.</returns>
439- public static OpenApiParameter CreateSearch ( this ODataContext context , IEdmVocabularyAnnotatable target )
444+ public static OpenApiParameter CreateSearch ( this ODataContext context , IEdmVocabularyAnnotatable target , OpenApiDocument document )
440445 {
441446 Utils . CheckArgumentNull ( context , nameof ( context ) ) ;
442447 Utils . CheckArgumentNull ( target , nameof ( target ) ) ;
448+ Utils . CheckArgumentNull ( document , nameof ( document ) ) ;
443449
444450 SearchRestrictionsType search = context . Model . GetRecord < SearchRestrictionsType > ( target , CapabilitiesConstants . SearchRestrictions ) ;
445451 if ( search == null || search . IsSearchable )
446452 {
447- return new OpenApiParameterReference ( "search" , null ) ;
453+ return new OpenApiParameterReference ( "search" , document ) ;
448454 }
449455
450456 return null ;
@@ -454,34 +460,38 @@ public static OpenApiParameter CreateSearch(this ODataContext context, IEdmVocab
454460 /// </summary>
455461 /// <param name="context">The OData context.</param>
456462 /// <param name="targetPath">The string representation of the Edm target path.</param>
463+ /// <param name="document">The Open API document to use to build references.</param>
457464 /// <returns></returns>
458- public static OpenApiParameter CreateSearch ( this ODataContext context , string targetPath )
465+ public static OpenApiParameter CreateSearch ( this ODataContext context , string targetPath , OpenApiDocument document )
459466 {
460467 Utils . CheckArgumentNull ( context , nameof ( context ) ) ;
461468 Utils . CheckArgumentNull ( targetPath , nameof ( targetPath ) ) ;
469+ Utils . CheckArgumentNull ( document , nameof ( document ) ) ;
462470
463471 IEdmTargetPath target = context . Model . GetTargetPath ( targetPath ) ;
464472 if ( target == null )
465473 return null ;
466474
467- return context . CreateSearch ( target ) ;
475+ return context . CreateSearch ( target , document ) ;
468476 }
469477
470478 /// <summary>
471479 /// Create the $count parameter.
472480 /// </summary>
473481 /// <param name="context">The OData context.</param>
474482 /// <param name="target">The Edm annotation target.</param>
483+ /// <param name="document">The Open API document to use to build references.</param>
475484 /// <returns>The created <see cref="OpenApiParameter"/> or null.</returns>
476- public static OpenApiParameter CreateCount ( this ODataContext context , IEdmVocabularyAnnotatable target )
485+ public static OpenApiParameter CreateCount ( this ODataContext context , IEdmVocabularyAnnotatable target , OpenApiDocument document )
477486 {
478487 Utils . CheckArgumentNull ( context , nameof ( context ) ) ;
479488 Utils . CheckArgumentNull ( target , nameof ( target ) ) ;
489+ Utils . CheckArgumentNull ( document , nameof ( document ) ) ;
480490
481491 CountRestrictionsType count = context . Model . GetRecord < CountRestrictionsType > ( target , CapabilitiesConstants . CountRestrictions ) ;
482492 if ( count == null || count . IsCountable )
483493 {
484- return new OpenApiParameterReference ( "count" , null ) ;
494+ return new OpenApiParameterReference ( "count" , document ) ;
485495 }
486496
487497 return null ;
@@ -492,34 +502,38 @@ public static OpenApiParameter CreateCount(this ODataContext context, IEdmVocabu
492502 /// </summary>
493503 /// <param name="context">The OData context.</param>
494504 /// <param name="targetPath">The string representation of the Edm target path.</param>
505+ /// <param name="document">The Open API document to use to build references.</param>
495506 /// <returns></returns>
496- public static OpenApiParameter CreateCount ( this ODataContext context , string targetPath )
507+ public static OpenApiParameter CreateCount ( this ODataContext context , string targetPath , OpenApiDocument document )
497508 {
498509 Utils . CheckArgumentNull ( context , nameof ( context ) ) ;
499510 Utils . CheckArgumentNull ( targetPath , nameof ( targetPath ) ) ;
511+ Utils . CheckArgumentNull ( document , nameof ( document ) ) ;
500512
501513 IEdmTargetPath target = context . Model . GetTargetPath ( targetPath ) ;
502514 if ( target == null )
503515 return null ;
504516
505- return context . CreateCount ( target ) ;
517+ return context . CreateCount ( target , document ) ;
506518 }
507519
508520 /// <summary>
509521 /// Create the $filter parameter.
510522 /// </summary>
511523 /// <param name="context">The OData context.</param>
512524 /// <param name="target">The Edm annotation target.</param>
525+ /// <param name="document">The Open API document to use to build references.</param>
513526 /// <returns>The created <see cref="OpenApiParameter"/> or null.</returns>
514- public static OpenApiParameter CreateFilter ( this ODataContext context , IEdmVocabularyAnnotatable target )
527+ public static OpenApiParameter CreateFilter ( this ODataContext context , IEdmVocabularyAnnotatable target , OpenApiDocument document )
515528 {
516529 Utils . CheckArgumentNull ( context , nameof ( context ) ) ;
517530 Utils . CheckArgumentNull ( target , nameof ( target ) ) ;
531+ Utils . CheckArgumentNull ( document , nameof ( document ) ) ;
518532
519533 FilterRestrictionsType filter = context . Model . GetRecord < FilterRestrictionsType > ( target , CapabilitiesConstants . FilterRestrictions ) ;
520534 if ( filter == null || filter . IsFilterable )
521535 {
522- return new OpenApiParameterReference ( "filter" , null ) ;
536+ return new OpenApiParameterReference ( "filter" , document ) ;
523537 }
524538
525539 return null ;
@@ -530,8 +544,9 @@ public static OpenApiParameter CreateFilter(this ODataContext context, IEdmVocab
530544 /// </summary>
531545 /// <param name="context">The OData context.</param>
532546 /// <param name="targetPath">The string representation of the Edm target path.</param>
547+ /// <param name="document">The Open API document to use to build references.</param>
533548 /// <returns></returns>
534- public static OpenApiParameter CreateFilter ( this ODataContext context , string targetPath )
549+ public static OpenApiParameter CreateFilter ( this ODataContext context , string targetPath , OpenApiDocument document )
535550 {
536551 Utils . CheckArgumentNull ( context , nameof ( context ) ) ;
537552 Utils . CheckArgumentNull ( targetPath , nameof ( targetPath ) ) ;
@@ -540,7 +555,7 @@ public static OpenApiParameter CreateFilter(this ODataContext context, string ta
540555 if ( target == null )
541556 return null ;
542557
543- return context . CreateFilter ( target ) ;
558+ return context . CreateFilter ( target , document ) ;
544559 }
545560
546561 public static OpenApiParameter CreateOrderBy ( this ODataContext context , string targetPath , IEdmEntityType entityType )
0 commit comments