File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -78,13 +78,11 @@ private static void TryAddParameterExamples(
7878 argument . ParameterType . GetExampleMetadata ( ) . FirstOrDefault ( ( p ) => p . SchemaType == argument . ParameterType ) ??
7979 examples . FirstOrDefault ( ( p ) => p . SchemaType == argument . ParameterType ) ;
8080
81- if ( metadata ? . GenerateExample ( Context ) is { } value )
81+ // Find the parameter that corresponds to the argument and set its example
82+ if ( metadata ? . GenerateExample ( Context ) is { } value &&
83+ parameters . FirstOrDefault ( ( p ) => p . Name == argument . Name ) is OpenApiParameter parameter )
8284 {
83- // Find the parameter that corresponds to the argument and set its example
84- if ( parameters . FirstOrDefault ( ( p ) => p . Name == argument . Name ) is OpenApiParameter parameter )
85- {
86- parameter . Example ??= value ;
87- }
85+ parameter . Example ??= value ;
8886 }
8987 }
9088 }
You can’t perform that action at this time.
0 commit comments