Skip to content

Unsupported 'format' value #103

@bgoesswe

Description

@bgoesswe

Hey,
I have the following setup:
Input OpenAPI snipped:
"url": {
"type": "string",
"description": "URL to a web page with more details about the plan.",
"format": "url",
"example": "http://cool-cloud-corp.com/plans/free-plan"
}

I then load swagger by file and create a filter router with the following lines:
openapi3.DefineStringFormat("url", REGEX)
swagger, err := openapi3.NewSwaggerLoader().LoadSwaggerFromFile(ct.apifile)
router := openapi3filter.NewRouter().WithSwagger(swagger)

The last line causes the following error:
panic: Validating Swagger failed: Unsupported 'format' value 'url'

Even though I added it to the string formats in the first line, am I doing something wrong?
Is there a solution to this? (the problem seems similar to #79)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions