swashbuckle.aspnetcore

How to configure Swashbuckle to ignore property on model for a specific api version only

守給你的承諾、 提交于 2021-02-11 14:39:48
问题 I needed to add a property to a model and I have implemented what is suggested in the selected answer here and it's working in that it removes the property I have tagged with SwaggerIgnorePropertyAttribute attribute of the model. My question is , if I have several API versions of my application,how to remove it from the swagger doc/schema for certain versions? I only care not to see the added property in swagger. I only really have 1 version of the model across the application even though I

NET core 2.0 Swagger & Enum Display

生来就可爱ヽ(ⅴ<●) 提交于 2020-12-15 05:28:44
问题 i have the next enum : public enum DataTypes { [Description("All")] All, Man, Woman } and i want to achive next : to display decription for each enum to display the Enum Key and Value. i used this next post : swagger-ui-web-api-documentation-present-enums-as-strings I did the next code changes : in the enum, i defined : [JsonConverter(typeof(StringEnumConverter))] //this is using newton public enum DataTypes { [Description("All")] All, [Description("Male222")] Male, [Description("Female")]

How do I setup Swashbucle v5 with swagger when I have a custom base url?

拟墨画扇 提交于 2020-05-27 13:23:27
问题 I am upgrading a .net API to .net Core 3.1 and using Swashbuckle.AspNetcore 5.4.1. The API is running inside a ServiceFabric app. I found this https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1173 and tried to follow that and swagger gets generated but if I try to use the Swagger UI to send requests the request URL is with the wrong IP so the request fail. In the old Swashbuckle 4.0.1 setup we did not specify host, only the reelative basePath. How can I archieve the same?

Note: AutoRest core version selected from configuration: ~2.0.4413 when I have installed 3.06187

人走茶凉 提交于 2020-04-18 03:47:53
问题 I have installed autorest 3.0.3187 on node v12.16.1 and I ran autorest --reset to remove old versions However when I run autorest --input-file=https://myapplication/mydocs/v1/swagger.json --output-folder=generated --csharp --namespace=MyNameSpace I get the following output NOTE: AutoRest core version selected from configuration: ~2.0.4413. Loading AutoRest core 'C:\Users\kirst\.autorest\@microsoft.azure_autorest- core@2.0.4417\node_modules\@microsoft.azure\autorest-core\dist' (2.0.4417)