info.title is missing when running from a LIVE app but not from localhost

Problem

We receive the following Swagger validation error after publishing to an Azure Web App. We do not receive the error when running locally in IIS Express from Visual Studio.

"messages":[ "attribute info.title is missing" ],
"schemaValidationMessages":[{ 
  "domain":"validation",
  "instance":{ "pointer":"/info" },
  "keyword":"required",
  "level":"error",
  "message":"object has missing required properties ([\"title\"])",
  "schema":{ "loadingURI":"http://swagger.io/v2/schema.json#",
  "pointer":"/definitions/info"
}}]

Solution

This is a message from the Swagger Schema Validator which is automatically disabled for localhost. That is why the error only occurs in LIVE site.

We can set the title like this:

app.UseSwagger((httpRequest, swaggerDocument) =>  
{
    swaggerDocument.Info.Title = "Green Earth Game";
});