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.

The provided definition does not specify a valid version field

See original GitHub issue
  • OS: macOS 10.12.6 (16G1510)
  • Browser: chrome
  • Version: 70.0.3538.110 (Official Build) (64-bit)
  • Method of installation: manual
  • Swagger-UI version: v3.18.3
  • Swagger/OpenAPI version: 3.0

Swagger/OpenAPI definition:


openapi: "3.0.0"

servers:
  - url: 'https://domain.test/api/v1'
    description: Dev server

info:
  title: API
  description: API Documentation
  version: '1.0'

paths:
  /:
    get:
      responses:
        '200':
          description: OK

Swagger-UI configuration options:


    <script>
    window.onload = function() {
      // Begin Swagger UI call region
      const ui = SwaggerUIBundle({
        url: "{{ $ymlFileUrl }}",
        dom_id: '#swagger-ui',
        deepLinking: true,
        presets: [
          SwaggerUIBundle.presets.apis,
          SwaggerUIStandalonePreset
        ],
        plugins: [
          SwaggerUIBundle.plugins.DownloadUrl
        ],
        layout: "StandaloneLayout"
      })
      // End Swagger UI call region

      window.ui = ui
    }
  </script>

When I hit the route serving Swagger-ui I have the following message displayed:

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).

When I test my definition on https://editor.swagger.io it is all good!

What am I missing?

Thank you,

J.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
bdzzaidcommented, Oct 10, 2020

I have the same issue when the server URL contains a server port (ex: http://myserver:80 or https://myserver:443).

I resolved all my url syntax and resolved the issue 😃

openapi: 3.0.3
info:
...
servers:
  - url: 'here an invalid URL' ...
1reaction
ghostcommented, Mar 4, 2020

Hi @armstronge975, I tried to solve the problem following the tutorial suggested by you, but problem still occurs. @jrean Could you please explain you solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swagger..Unable to render this definition The provided ...
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 ...
Read more >
Integrated Swagger UI throws error on valid OpenAPI spec file
The provided definition does not specify a valid version field. Please indicate a valid Swagger or OpenAPI version field. Supported version ...
Read more >
Unable to render this definition.The provided ...
I get this following error: Unable to render this definition The provided definition does not specify a valid version field. Please indicate a ......
Read more >
Bug #2000311 “Unable to render this definition The ...
The provided definition does not specify a valid version field. Please indicate a valid Swagger or OpenAPI version field. Supported version ...
Read more >
Unable to render this definition The provided defi...
The provided definition does not specify a valid version field. Please indicate a valid Swagger or OpenAPI version field.
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