OpenAPI-Specification icon indicating copy to clipboard operation
OpenAPI-Specification copied to clipboard

empty host causes schema validation failure

Open paulhill opened this issue 12 years ago • 4 comments

should be valid if relative pathing is being used. (I updated swagger-ui to work with relative paths)

{
    "level": "error",
    "domain": "validation",
    "keyword": "pattern",
    "message": "ECMA 262 regex \"^[^{}/ :\\\\]+(?::\\d+)?$\" does not match input string \"\"",
    "schema": {
        "loadingURI": "#",
        "pointer": "/properties/host"
    },
    "instance": {
        "pointer": "/host"
    }
}

paulhill avatar Nov 19 '14 05:11 paulhill

Can you share a small sample to reproduce it?

webron avatar Nov 19 '14 05:11 webron

{
    swagger: '2.0',
    info: {
        title: 'My API',
        version: '2.0'
    },
    host: '',
    schemes: [],
    basePath: '/api/v2',
    consumes: [
        'application/json'
    ],
    produces: [
        'application/json'
    ],
    paths: ...,
    definitions: ...,
    parameters: ...,
    responses: ...
}

paulhill avatar Nov 24 '14 18:11 paulhill

Fine, I should have asked for an addition to the fixtures so I'd be forced to fix it ;) But I'll look into it. Thanks for reporting.

webron avatar Nov 24 '14 19:11 webron

Should be fixed now.

webron avatar Jul 30 '15 15:07 webron