oas3-api-snippet-enricher icon indicating copy to clipboard operation
oas3-api-snippet-enricher copied to clipboard

URL should match format "uri"

Open thim81 opened this issue 5 years ago • 3 comments

Hi,

I try to enrich a JSON generated file that is in a valid openapi JSON format and properly renders in Redoc.

But still I get this error:

[Error [HARError]: validation failed] {
  errors: [
    {
      keyword: 'format',
      dataPath: '.url',
      schemaPath: '#/properties/url/format',
      params: { format: 'uri' },
      message: 'should match format "uri"'
    }
  ]
}

It is clear that there is something wrong with the URL, but I have no idea where to look.

Could you point in the right direction? Or is there an option to show more detailed debug output?

thim81 avatar Sep 28 '20 13:09 thim81

Seems like a message from the underlying Kong library, I would try there https://github.com/Kong/httpsnippet

On Sep 28, 2020, 3:31 PM +0200, thim81 [email protected], wrote:

Hi, I try to enrich a JSON generated file that is in a valid openapi JSON format and properly renders in Redoc. But still I get this error: [Error [HARError]: validation failed] { errors: [ { keyword: 'format', dataPath: '.url', schemaPath: '#/properties/url/format', params: { format: 'uri' }, message: 'should match format "uri"' } ] } It is clear that there is something wrong with the URL, but I have no idea where to look. Could you point in the right direction? Or is there an option to show more detailed debug output? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

andrzejwp avatar Sep 28 '20 14:09 andrzejwp

@thim81 I had the same problem. In my case, I inadvertently had a space in an OpenAPI server URI.

TimUnderhay avatar Nov 04 '20 15:11 TimUnderhay

@KensingtonTech

This how my servers object looks like:

  "servers": [
    {
      "url": "{baseUrl}",
      "variables": {
        "baseUrl": {
          "default": "https://acme.com",
          "description": "Base URL domain"
        }
      }
    }
  ],

There is no spaces, but I still get the error.

thim81 avatar Dec 18 '20 12:12 thim81