C# 招摇过市codegen忽略空字符串
我使用用户swagger codegen cli 2.4.8为带有这些标志的rest api生成客户端C# 招摇过市codegen忽略空字符串,c#,rest,swagger-codegen,C#,Rest,Swagger Codegen,我使用用户swagger codegen cli 2.4.8为带有这些标志的rest api生成客户端 java -jar swagger-codegen-cli.jar generate -i http://xxxxxxx.com/swagger/v1/swagger.json -l csharp -c config.json -o c:\dev\xxxxxClient 其中config.json包含 { "packageName": "xxxxxxxxx.Client",
java -jar swagger-codegen-cli.jar generate -i http://xxxxxxx.com/swagger/v1/swagger.json -l csharp -c config.json -o c:\dev\xxxxxClient
其中config.json包含
{
"packageName": "xxxxxxxxx.Client",
"targetFramework": "v5.0"
}
一切正常,但我希望它省略一个不需要的空字符串。
我做以下几点
var subScriptionResponse = await subscriptionApiClient.UpdateAsync(dbLicense.PublicIdString, new UpdateSubscriptionRequest() { CancelAtPeriodEnd = delete });
但是,UpdateSubscriptionRequest有两个属性,生成的构造函数如下所示
public UpdateSubscriptionRequest(bool? cancelAtPeriodEnd = default(bool?), string taxId = default(string))
{
this.CancelAtPeriodEnd = cancelAtPeriodEnd;
this.TaxId = taxId;
}
这意味着我不能省略不需要的taxId。但是,如果设置,则必须为有效值。所以restapi只是用
您为“默认税率[0]”传递了一个空字符串。我们假设是空的
值是试图取消设置参数;然而
“默认税率[0]”不能取消设置。你应该删除
“默认税率[0]”来自您的请求或提供的非空值
我想更新CancelAtPeriodEnd,而不使用TaxId
你知道我怎样才能和斯威格·科德根合作吗