question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

One machine generates an open API document with descriptions for ProblemDetails and another machine generates them without

See original GitHub issue

I’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:closed
  • Created 2 years ago
  • Comments:21 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
RicoSutercommented, Aug 4, 2021

It would be something if we could disable the scanning altogether so we can at least have consistent results across machines.

In next version this can be disabled with XmlDocs.ResolveFromNuGetCacheOrDotNetSdk = false; - just call this before generation, e.g. in Program.cs

1reaction
RicoSutercommented, Aug 4, 2021

Soon: https://github.com/RicoSuter/NSwag/pull/3582 (v13.13.0) However, I really want to find a fix for this - not just disable it 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

ProblemDetails Class (Microsoft.AspNetCore.Mvc)
A machine-readable format for specifying errors in HTTP API responses based on https://tools.ietf.org/html/rfc7807.
Read more >
RFC 7807 - Problem Details for HTTP APIs
Problem Details for HTTP APIs (RFC 7807, March 2016; obsoleted by RFC 9457) ... This document defines a "problem detail" as a way...
Read more >
10 Essentials When Creating an Open API Specification
Below, we'll run through what the OpenAPI Specification is, including OpenAPI vs Swagger, then look at 10 essentials for creating OpenAPIs. What ...
Read more >
API Documentation Made Easy with OpenAPI & Swagger
Generating documentation for your API is just one of the advantages of defining your API with OpenAPI. Other benefits include:.
Read more >
OpenAPI | IntelliJ IDEA Documentation
An OpenAPI Specification (OAS) is a description format for REST APIs. Swagger is a set of tools based on this specification for writing, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found