Unable to render this definition The provided definition does not specify a valid version field.
Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: “2.0” and those that match openapi: 3.0.n (for example, openapi: 3.0.0).
Where do I need to insert the correct version to the stop the error below. Swagger editor works ok, but when launching a particular project I receive this error.First time using Swagger. Many Thanks
Advertisement
Answer
Your API definition is missing the OpenAPI/Swagger version number, in this case "swagger": "2.0"
. Add it at the beginning, like so:
JavaScript
x
6
1
{
2
"swagger": "2.0",
3
4
"title" : "Music API Documentation",
5
6