I have an error on the Swagger API documentation/List page. All the calls work properly its just that the image detailing error is not a comfortable look. When I drill into the error I receive the following json response:
{"schemaValidationMessages":[{"level":"error","domain":"validation","keyword":"minItems","message":"array is too short: must have at least 1 elements but instance has 0 elements","schema":{"loadingURI":"http://json-schema.org/draft-04/schema#","pointer":"/properties/enum"},"instance":{"pointer":"/definitions/Permissions/properties/permissionType/enum"}}]}
Swagger will always validate your schema against their online validator. In your case it has failed validation because of the permissionType enum having no elements, as per the JSON returned. If you really want to and fixing the issue is not viable then you can turn the validation off using Swagger's validatorUrl
parameter - see this link . If you wish to do this via Swashbuckle you could use:
.EnableSwaggerUi(c =>
{
// Your other config...
c.DisableValidator();
});
as per the Swashbuckle documentation
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.