swagger-api / validator-badge

Validate your Swagger JSON/YAML today!
http://swagger.io
Apache License 2.0
210 stars 85 forks source link

Warning: format attribute \"uri-reference\" not supported #170

Closed sdelatorrep closed 4 years ago

sdelatorrep commented 4 years ago

I got these warnings:

{
  "schemaValidationMessages": [
    {
      "level": "warning",
      "domain": "validation",
      "keyword": "format",
      "message": "format attribute \"uri-reference\" not supported",
      "schema": {
        "loadingURI": "#",
        "pointer": "/definitions/ExternalDocumentation/properties/url"
      }
    },
    {
      "level": "warning",
      "domain": "validation",
      "keyword": "format",
      "message": "format attribute \"uri-reference\" not supported",
      "schema": {
        "loadingURI": "#",
        "pointer": "/definitions/License/properties/url"
      }
    }
  ]
}

When validating this YAML: http://validator.swagger.io/validator/debug?url=https://raw.githubusercontent.com/ga4gh-beacon/specification-v2/master/beacon.yaml The issue seems to be in this part of the definition:

openapi: 3.0.2
servers: []
info:
  version: "2.0"
  title: GA4GH Beacon API Specification
  description: >-
    A Beacon is a web service for genetic data sharing that can be queried for information about variants, individuals or samples.
  contact:
    email: beacon@ga4gh.org
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
externalDocs:
  description: 'Beacon Project'
  url: http://beacon-project.io/

But, according to the spec (e.g. externalDocs) both URLs in license and externalDocs are valid, so I don't understand why the validator is throwing this warning and I wonder if it is an error.

Thanks!

webron commented 4 years ago

As these are warnings, you can safely ignore them. The reason for the warning is some differences in JSON Schema over the years and what the supported formats are. It's not saying there's an error with your file just that it does not recognize the provided format used by the JSON Schema.

sdelatorrep commented 4 years ago

Understood. Thanks!

fabich commented 4 years ago

@webron why is validator.swagger.io returning these warnings if they should be ignored? We are automatically validating OpenAPI specification files in CI and having some warnings that should be ignored makes these checks not that easy ...

frantuma commented 3 years ago

Warnings have been fixed in latest validator v2.0.5 (#181) and https://validator.swagger.io/