@@ -22,28 +22,28 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context)
2222
2323 foreach ( var par in pars )
2424 {
25- var swaggerParam = operation . Parameters . SingleOrDefault ( p => p . Name == par . Name ) ;
25+ var openapiParam = operation . Parameters . SingleOrDefault ( p => p . Name == par . Name ) ;
2626
2727 var attributes = ( ( ControllerParameterDescriptor ) par . ParameterDescriptor ) . ParameterInfo . CustomAttributes . ToList ( ) ;
2828
2929 // See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1147
3030 // and https://mikeralphson.github.io/openapi/2017/03/15/openapi3.0.0-rc0
3131 // Basically OpenAPI v3 body parameters are split out into RequestBody and the properties have moved to schema
32- if ( attributes . Any ( ) && swaggerParam != null )
32+ if ( attributes . Any ( ) && openapiParam != null )
3333 {
3434 // Required - [Required]
3535 var requiredAttr = attributes . FirstOrDefault ( p => p . AttributeType == typeof ( RequiredAttribute ) ) ;
3636 if ( requiredAttr != null )
3737 {
38- swaggerParam . Required = true ;
38+ openapiParam . Required = true ;
3939 }
4040
4141 // Regex Pattern [RegularExpression]
4242 var regexAttr = attributes . FirstOrDefault ( p => p . AttributeType == typeof ( RegularExpressionAttribute ) ) ;
4343 if ( regexAttr != null )
4444 {
4545 var regex = ( string ) regexAttr . ConstructorArguments [ 0 ] . Value ;
46- swaggerParam . Schema . Pattern = regex ;
46+ openapiParam . Schema . Pattern = regex ;
4747 }
4848
4949 // String Length [StringLength]
@@ -72,12 +72,12 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context)
7272
7373 if ( minLength != null )
7474 {
75- swaggerParam . Schema . MinLength = minLength ;
75+ openapiParam . Schema . MinLength = minLength ;
7676 }
7777
7878 if ( maxLength != null )
7979 {
80- swaggerParam . Schema . MaxLength = maxLength ;
80+ openapiParam . Schema . MaxLength = maxLength ;
8181 }
8282
8383 // Range [Range]
@@ -87,8 +87,8 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context)
8787 var rangeMin = ( int ) rangeAttr . ConstructorArguments [ 0 ] . Value ;
8888 var rangeMax = ( int ) rangeAttr . ConstructorArguments [ 1 ] . Value ;
8989
90- swaggerParam . Schema . MinLength = rangeMin ;
91- swaggerParam . Schema . MaxLength = rangeMax ;
90+ openapiParam . Schema . MinLength = rangeMin ;
91+ openapiParam . Schema . MaxLength = rangeMax ;
9292 }
9393 }
9494 }
0 commit comments