One machine generates an open API document with descriptions for ProblemDetails and another machine generates them without
See original GitHub issueI’ve got this weird case where one machine generates an open API document with descriptions for ProblemDetails
(from Microsoft.AspNetCore.Mvc
) and another machine generates them without.
Here’s an excerpt:
"ProblemDetails": {
"type": "object",
"description": "A machine-readable format for specifying errors in HTTP API responses based on https://tools.ietf.org/html/rfc7807.",
"additionalProperties": {
"nullable": true
},
"properties": {
"type": {
"type": "string",
"description": "A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when\ndereferenced, it provide human-readable documentation for the problem type\n(e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be\n\"about:blank\".",
"nullable": true
},
"title": {
"type": "string",
"description": "A short, human-readable summary of the problem type.It SHOULD NOT change from occurrence to occurrence\nof the problem, except for purposes of localization(e.g., using proactive content negotiation;\nsee[RFC7231], Section 3.4).",
"nullable": true
},
And the same document but now without descriptions:
"ProblemDetails": {
"type": "object",
"additionalProperties": {
"nullable": true
},
"properties": {
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
I’m using the exact same code on both machines, calling AspNetCoreOpenApiDocumentGenerator
.
I’ve checked the generation configuration for anything referring to the inclusion of descriptions/summaries/documentation but I didn’t find it.
The only other thing I can think of right now is the absence of an Microsoft.AspNetCore.Mvc.XML
file on the machine that generates the document without the descriptions. But that file, nor its DLL counterpart, is not in my bin directory. That’s probably due to the fact that my project is configured with the Microsoft.NET.Sdk.Web
SDK and the Mvc DLL is referenced implicitly.
Issue Analytics
- State:
- Created 2 years ago
- Comments:21 (13 by maintainers)
In next version this can be disabled with
XmlDocs.ResolveFromNuGetCacheOrDotNetSdk = false;
- just call this before generation, e.g. in Program.csSoon: https://github.com/RicoSuter/NSwag/pull/3582 (v13.13.0) However, I really want to find a fix for this - not just disable it 😃