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.

2.0.18 regression wrong error message when validating the server url

See original GitHub issue

This example spec:

openapi: 3.0.0
info:
  title: Issue with server
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
- url: http://{server}.swagger.io:{port}/v2
  description: petstore server
  variables:
    server:
      default: petstore
      enum:
      - petstore
      - qa-petstore
      - dev-petstore
    port:
      default: "80"
      enum:
      - "80"
      - "8080"
- url: https://localhost:8080/{version}
  description: The local server
  variables:
    version:
      default: v2
      enum:
      - v1
      - v2
paths:
  /ping:
    get:
      operationId: pingGet
      responses:
        '201':
          description: OK

With version 2.0.18 this is now reporting errors:

attribute .servers. invalid url : http://{server}.swagger.io:{port}/v2
attribute .servers. invalid url : https://localhost:8080/{version}

With 2.0.17 this was not the case.


This can also be reproduced with the example provided in the official spec: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#server-object-example

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
gavl-cdlcommented, Mar 5, 2020

This appears to happen with relative URLs, too. For example:

{
  "openapi": "3.0.2",
  "servers": [
    {
      "url": "/api/v1"
    }
  ]
  [snip]
}

generates: attribute .servers. invalid url : /api/v1

2reactions
gracekarinacommented, Mar 1, 2020

Hi, I’m going to review why has this regression happend and work a fix, if indeed we need to reverse we will. Thanks! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Validate servers failing in Portal - Esri Community
When I log into the Portal Admin and do a validate the status of Failure is returned on both Servers with the Following...
Read more >
v2.0.19 released! - InspIRCd
This release fixes the issues discovered since 2.0.18, containing multiple important stability and correctness related improvements, ...
Read more >
Changelog | Cypress Documentation
1. Bugfixes: Fixed a regression in 11.2. 0 where a stale spec search pattern was shown in the spec search bar after re-launching...
Read more >
Apache Tomcat 9 (9.0.70) - Changelog
Include the name of the current stream state in the error message when a stream is cancelled due to an attempt to write...
Read more >
Diff - gerrit - Google Git
+If false and ldap.server is an `ldaps://` style URL or `ldap. ... diff --git a/Documentation/error-messages.txt b/Documentation/error-messages.txt index ...
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