Visual studio 配置Visual Studio用于修复日期时间/偏移量问题的OpenAPI客户端生成器
我有一个ASP.NETCore5WebAPI,它使用Swagger生成OpenAPI3JSON文件。在我的Blazor WASM客户端上使用Visual Studo 2019(16.8.2),我为该json文件添加了一个服务引用 所有这些都工作正常,但由于某些原因,VisualStudio生成的POCO(?NSWag可能基于引用)都使用Visual studio 配置Visual Studio用于修复日期时间/偏移量问题的OpenAPI客户端生成器,visual-studio,asp.net-core,swagger,openapi-generator,asp.net-core-5.0,Visual Studio,Asp.net Core,Swagger,Openapi Generator,Asp.net Core 5.0,我有一个ASP.NETCore5WebAPI,它使用Swagger生成OpenAPI3JSON文件。在我的Blazor WASM客户端上使用Visual Studo 2019(16.8.2),我为该json文件添加了一个服务引用 所有这些都工作正常,但由于某些原因,VisualStudio生成的POCO(?NSWag可能基于引用)都使用DateTimeOffset 现在我想我需要设置一个设置useDateTimeOffset,但不知道在哪里或如何设置 编辑:看起来DateTimeOffset是通
DateTimeOffset
现在我想我需要设置一个设置useDateTimeOffset
,但不知道在哪里或如何设置
编辑:看起来DateTimeOffset
是通用日期的推荐数据类型。但我还是想知道如何改变选项
在这种情况下,OpenAPI3 json存在问题,targetDate
应仅为日期,dateRaised
应为日期和时间:
"InitialRequestDTO": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"requesterName": {
"type": "string",
"nullable": true
},
"sponsorName": {
"type": "string",
"nullable": true
},
"requestTitle": {
"type": "string",
"nullable": true
},
"ownReference": {
"type": "string",
"nullable": true
},
"dateRaised": {
"type": "string",
"format": "date-time"
},
"details": {
"type": "string",
"nullable": true
},
"existingApplicationId": {
"type": "integer",
"format": "int32",
"nullable": true
},
"targetDate": {
"type": "string",
"format": "date",
"nullable": true
},
"benefits": {
"type": "string",
"nullable": true
},
"externalDependencies": {
"type": "string",
"nullable": true
},
"nameOfLargerChange": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},