Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response generation hangs indefinitely #62

Open
crizzis opened this issue Aug 4, 2021 · 0 comments
Open

Response generation hangs indefinitely #62

crizzis opened this issue Aug 4, 2021 · 0 comments

Comments

@crizzis
Copy link

crizzis commented Aug 4, 2021

Using the following config:

covidbevis-mock:
    image: muonsoft/openapi-mock
    environment:
      OPENAPI_MOCK_SPECIFICATION_URL: '/data/covidBevisApiSchema.json'
      OPENAPI_MOCK_PORT: 8453
      OPENAPI_MOCK_RESPONSE_TIMEOUT: '30.0'
      OPENAPI_MOCK_DEBUG: 'true'
      OPENAPI_MOCK_USE_EXAMPLES: 'if_present'
    ports:
      - '8453:8453'
    volumes:
      - ./resources:/data

where covidBevisApiSchema.json is defined as:

{
  "openapi": "3.0.0",
  "info": {
    "description": "This is the REST API description for the Swedish test proof solution.",
    "version": "0.1",
    "title": "Swedish Test proof REST API",
    "termsOfService": "Terms of service",
    "contact": {
      "name": "Myndigheten för Digital förvaltning",
      "url": "http://www.digg.se",
      "email": "[email protected]"
    },
    "license": {
      "name": "MIT License",
      "url": "API license URL"
    }
  },
  "tags": [
    {
      "name": "test-submission-controller",
      "description": "Test Submission Controller"
    }
  ],
  "paths": {
    "/observation": {
      "post": {
        "tags": [
            "test-submission-controller"
        ],
        "summary": "Operation for submitting a test observation",
        "operationId": "submitObservationUsingPOST",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "description": "request body",
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestSubmissionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "//localhost:8453/"
    }
  ],
  "components": {
    "schemas": {
      "Coding": {
        "type": "object",
        "required": [
            "code",
            "display"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "display": {
            "type": "string"
          }
        },
        "title": "Coding"
      },
      "Delivery": {
        "type": "object",
        "required": [
            "serviceSupplier"
        ],
        "properties": {
          "delivered": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2147483647
          },
          "serviceSupplier": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2147483647
          }
        },
        "title": "Delivery"
      },
      "Proof": {
        "type": "object",
        "required": [
            "content",
            "mimetype"
        ],
        "properties": {
          "content": {
            "type": "string"
          },
          "delivery": {
            "$ref": "#/components/schemas/Delivery"
          },
          "mimetype": {
            "type": "string",
            "minLength": 3,
            "maxLength": 2147483647
          }
        },
        "title": "Proof"
      },
      "ProofQRCode": {
        "type": "object",
        "required": [
            "height",
            "image",
            "mimetype",
            "width"
        ],
        "properties": {
          "height": {
            "type": "integer",
            "format": "int32",
            "example": 400
          },
          "image": {
            "type": "string",
            "example": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAAAAACl1GkQAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAABIAAAASABGyWs+AAAJuklEQVR42u3dwXKrSgyE4fH7vyRvMBuKLXd9TVU6fVoaQ/zP1kmM+cyQkpA0xtr1muf/1nzV/v776+8r/fk/twABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEBqQNw/oH5///kEH48DeRUv+Q3/+ecvx6N+f5s/ri0FaT4/Vw/xgdwlT4D6+ffjOdXvZ18QucU1n58ryHGWLneLuPy8eTx7uIVKkObzYx+gu7pvuume33088fECAggggAACCCCAAAIIIIAAAggggAByXxCR/ygHOZ4G4saT4yvk5/yH/QFV+H0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yMjowMDozMi0wODowMLSXKGgAAABHdEVYdHNvZnR3YXJlAEltYWdlTWFnaWNrIDYuNy43LTEwIDIwMTctMDctMzEgUTE2IGh0dHA6Ly93d3cuaW1hZ2VtYWdpY2sub3JnSW9S5wAAABh0RVh0VGh1bWI6OkRvY3VtZW50OjpQYWdlcwAxp/+7LwAAABh0RVh0VGh1bWI6OkltYWdlOjpoZWlnaHQANTAwN8UAPAAAABd0RVh0VGh1bWI6OkltYWdlOjpXaWR0aAA1MDDraVOxAAAAGXRFWHRUaHVtYjo6TWltZXR5cGUAaW1hZ2UvcG5nP7JWTgAAABd0RVh0VGh1bWI6Ok1UaW1lADE1MTY0MjgwMzJ1Pn10AAAAE3RFWHRUaHVtYjo6U2l6ZQA0LjA0S0JCqTs4QQAAAABJRU5ErkJggg=="
          },
          "mimetype": {
            "type": "string",
            "minLength": 3,
            "maxLength": 2147483647,
            "example": "image/png"
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "example": 400
          }
        },
        "title": "ProofQRCode"
      },
      "Test": {
        "type": "object",
        "required": [
            "id",
            "targetDisease",
            "testResult",
            "typeOfTest"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "sampleCollectionDateTime": {
            "type": "string",
            "format": "date-time"
          },
          "targetDisease": {
            "$ref": "#/components/schemas/Coding"
          },
          "testManufacturer": {
            "$ref": "#/components/schemas/Coding"
          },
          "testName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2147483647
          },
          "testResult": {
            "$ref": "#/components/schemas/Coding"
          },
          "typeOfTest": {
            "$ref": "#/components/schemas/Coding"
          }
        },
        "title": "Test"
      },
      "TestPersonData": {
        "type": "object",
        "properties": {
          "birthDate": {
            "type": "string",
            "format": "date"
          },
          "familyName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2147483647
          },
          "givenName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2147483647
          },
          "identity": {
            "type": "string",
            "minLength": 12,
            "maxLength": 12,
            "pattern": "^((18|19|20)[0-9]{2}(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[0-9]{4})$"
          }
        },
        "title": "TestPersonData"
      },
      "TestProof": {
        "type": "object",
        "required": [
            "metadata",
            "qrCode",
            "subject",
            "test"
        ],
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/TestProofMetadata"
          },
          "qrCode": {
            "$ref": "#/components/schemas/ProofQRCode"
          },
          "subject": {
            "$ref": "#/components/schemas/TestPersonData"
          },
          "test": {
            "$ref": "#/components/schemas/Test"
          }
        },
        "title": "TestProof"
      },
      "TestProofMetadata": {
        "type": "object",
        "required": [
            "country",
            "issuanceDate",
            "issuer",
            "uvci",
            "validThrough"
        ],
        "properties": {
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2147483647
          },
          "issuanceDate": {
            "type": "string",
            "format": "date"
          },
          "issuer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2147483647
          },
          "uvci": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2147483647
          },
          "validThrough": {
            "type": "string",
            "format": "date-time",
            "example": "2017-07-21T17:32:28Z"
          }
        },
        "title": "TestProofMetadata"
      },
      "TestSubmissionResponse": {
        "type": "object",
        "required": [
            "proofTypes",
            "testProof"
        ],
        "properties": {
          "proofTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Proof"
            }
          },
          "testProof": {
            "$ref": "#/components/schemas/TestProof"
          }
        },
        "title": "TestSubmissionResponse"
      }
    }
  }
}

The following request:
Zrzut ekranu 2021-08-4 o 11 29 56

Results in the mock taking all the available time to respond (=30 sec), then responding with 503 Error

Container logs:

time="2021-08-04T09:28:05Z" level=info msg="OpenAPI specification was successfully loaded from '/data/covidBevisApiSchema.json'"
time="2021-08-04T09:28:05Z" level=info msg="OpenAPI mock server was created" CORSEnabled=false Debug=true DefaultMaxFloat=1.073741823e+09 DefaultMaxInt=2147483647 DefaultMinFloat=-1.073741823e+09 DefaultMinInt=0 LogFormat=tty LogLevel=trace NullProbability=0.5 Port=8453 ResponseTimeout=30s SpecificationURL=/data/covidBevisApiSchema.json SuppressErrors=false UseExamples=if_present
time="2021-08-04T09:28:05Z" level=info msg="[HTTP]: 2021/08/04 09:28:05 3628537b5fbc - Starting server on port :8453"
time="2021-08-04T09:32:28Z" level=info msg="[contentTypeNegotiator] best media type 'application/json' was negotiated for accept header '*/*'" requestId=35cdc14c-fcab-4bf7-8b80-b8ff68dd383c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant