Swagger (Swashbuckle for C#) shows Mongo ObjectId as several fields instead of single string
- 阅读更多 关于 Swagger (Swashbuckle for C#) shows Mongo ObjectId as several fields instead of single string
问题 I have controller method with ObjectId params: [ProducesResponseType(200, Type = typeof(Test))] [HttpGet] [Route("{id}")] public IActionResult Get(ObjectId id) {... For this API method swagger generates a form with both of complex ObjectId model and string Id instead of single string param: How I can remove extra fields and keep only string Id? 回答1: Find out what answer from another story also adresses this issue: services.AddMvc(options => { ... options.ModelMetadataDetailsProviders.Add( new