Skip to content

OpenAPIV2Deserializer should handle invalid host value gracefully #319

Closed

Description

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

Activity

  1. changed the title [-]OpenAPIV2Deserializer should handle invalid v2 document gracefully[/-] [+]OpenAPIV2Deserializer should handle invalid host value gracefully[/+] on Sep 19, 2018
  2. added a commit that references this issue on Oct 31, 2018
  3. epet commented on Dec 7, 2018

    @epet

    we are still seeing this after updating to 1.1.0

  4. erikj180 commented on Dec 10, 2018

    @erikj180

    check that, I meant 1.1.1 has been deployed to our service and we are still seeing this issue. Please reopen.

  5. PerthCharern commented on Dec 12, 2018

    @PerthCharern
    Contributor

    The issue is fixed in #340, but it has not been released. I'll release a new patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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