Permalink
Browse files

Path parameters are always required

  • Loading branch information...
RSuter committed Jan 10, 2018
1 parent a6317fa commit 507e37e31e98b3a7c72ecd639a9cd43f024f547e
@@ -117,7 +117,7 @@ public async Task SwaggerGeneration_IncludesMetadataForPrimitiveAndEnumTypes()
parameter =>
{
Assert.Equal("skip", parameter.Name);
Assert.False(parameter.IsRequired);
Assert.True(parameter.IsRequired);
Assert.Equal(SwaggerParameterKind.Path, parameter.Kind);
Assert.Equal(JsonObjectType.Integer, parameter.Type);
},
@@ -87,7 +87,7 @@ public async Task<bool> ProcessAsync(OperationProcessorContext operationProcesso
{
var operationParameter = await CreatePrimitiveParameterAsync(context, extendedApiParameter).ConfigureAwait(false);
operationParameter.Kind = SwaggerParameterKind.Path;
operationParameter.IsRequired = !apiParameter.RouteInfo.IsOptional;
operationParameter.IsRequired = true; // apiParameter.RouteInfo?.IsOptional == false;
context.OperationDescription.Operation.Parameters.Add(operationParameter);
}

0 comments on commit 507e37e

Please sign in to comment.