Skip to content

OpenAPIV2Deserializer should handle invalid host value gracefully #319

@Shwetap05

Description

@Shwetap05

If an V2 OpenApiDocument have invalid host e.g below, then OpenApiStringReader().Read is throwing an unhandled exception with message ": 'Input string was not in a correct format.'" , instead of handling the error gracefully and throwing a validation error for it.

{
"swagger": "2.0",
"info": {
"version": "v1",
"title": "Test API",
"description": "Test"
},
"host": "https://test.microsoft.com",
"paths": {
"/analytics/driver/measureData/{id}": {
"get": {
"tags": [ "test" ],
"summary": "Gets the test status.",
"operationId": "test",
"consumes": [],
"produces": [ "application/json" ],
"parameters": [
{
"name": "id",
"in": "path",
"description": "The shipping label identifier.",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "Success",
"type": "integer"
}
}
}
}
},
"definitions": {
}
}

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