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

RESTler is logging error for missing parameter in the response even when the parameter is not configured for the specific response code #883

Open
SwamyNallamalli opened this issue Mar 27, 2024 · 0 comments

Comments

@SwamyNallamalli
Copy link
Collaborator

Description

Configured a service with a value expected in response header for status code 200.
A request resulted in a status code 400, but RESTler is logging an error that value is missing in response.

Steps to reproduce

Spec:
"responses": { "200": { "description": "The request has succeeded.", "headers": { "ETag": { "required": true, "schema": { "type": "string" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Models.TenantResource" } } } }, "default": { "description": "An unexpected error response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Models.ErrorResponse" } } } }

Request:
2024-03-22 18:36:25.930: Sending: 'PUT /tenants/public:simself:f8ce4953-ce54-4eaa-b6de-144292939e90?api-version=2023-05-01 HTTP/1.1\r\nAccept: application/json\r\nHost: targets-capabilities.westus2.chaos-test.azure.com\r\nIf-Match: fuzzstring\r\nContent-Type: application/json\r\n_OMITTED_AUTH_TOKEN_\r\nContent-Length: 456\r\nUser-Agent: SimulatedSelfhost/C6584DEF-2F60-4967-A8EC-2B7F65507E42\r\nx-restler-sequence-id: 1ffaf9fb-4325-4db0-b29c-030d7fbde879\r\n\r\n{\n "properties":\n {\n "state":\n "Registered"\n ,\n "featureFlags":\n [\n {\n "name":"fuzzstring"\n }\n ],\n "quotaLimits":\n [\n {\n "name":"foobar",\n "value":1\n }\n ],\n "additionalProperties":{ "fuzz": false }\n }\n }\r\n'

Response:
2024-03-22 18:36:26.024: Received: 'HTTP/1.1 412 Precondition Failed\r\nDate: Fri, 22 Mar 2024 18:36:25 GMT\r\nContent-Type: application/json; charset=utf-8\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\nRequest-Context: appId=\r\nStrict-Transport-Security: max-age=15724800; includeSubDomains\r\n\r\n86\r\n{"status":"Failed","error":{"code":"PreconditionFailed","message":"The entity tag \'fuzzstring\' does not match.","correlationId":null}}\r\n0\r\n\r\n'

RESTler logging error:
2024-03-22 18:36:26.024: Parser exception: 'Error: all of the expected dynamic objects were not present in the response.'.

Expected results

No response

Actual results

No response

Environment details

No response

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