cdwv / oas3-api-snippet-enricher

Enrich your OpenAPI 3.0 JSON with code samples
MIT License
90 stars 13 forks source link

URL should match format "uri" #15

Open thim81 opened 3 years ago

thim81 commented 3 years ago

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?

andrzejwp commented 3 years ago

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 notifications@github.com, 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.

TimUnderhay commented 3 years ago

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

thim81 commented 3 years ago

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