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": {
}
}