From c5852b4c42a87bbcc9749206eabcc44f8a9863ae Mon Sep 17 00:00:00 2001 From: Firmino Changani Date: Fri, 29 Dec 2023 15:55:49 +0000 Subject: [PATCH] feat: include the response body on FullIncident model (#134) --- api/openapi.yml | 4 ++- internal/ports/http/mappers.go | 1 + internal/ports/http/server.gen.go | 57 ++++++++++++++++--------------- tests/client/client.gen.go | 57 ++++++++++++++++--------------- 4 files changed, 62 insertions(+), 57 deletions(-) diff --git a/api/openapi.yml b/api/openapi.yml index 56b7144..cb56fe9 100644 --- a/api/openapi.yml +++ b/api/openapi.yml @@ -374,7 +374,7 @@ components: allOf: - $ref: '#/components/schemas/Incident' - type: object - required: [response_headers, response_status, request_headers] + required: [response_headers, response_status, response_body, request_headers] properties: response_headers: type: string @@ -382,6 +382,8 @@ components: type: string response_status: type: integer + response_body: + type: string LogInPayload: required: [ token ] properties: diff --git a/internal/ports/http/mappers.go b/internal/ports/http/mappers.go index ccbe132..dd3f0cd 100644 --- a/internal/ports/http/mappers.go +++ b/internal/ports/http/mappers.go @@ -62,6 +62,7 @@ func mapIncidentToFullIncidentResponse(incident *monitor.Incident) FullIncident ResolvedAt: incident.ResolvedAt(), ResponseHeaders: incident.Details().RequestHeaders, ResponseStatus: int(incident.Details().Status), + ResponseBody: incident.Details().ResponseBody, } } diff --git a/internal/ports/http/server.gen.go b/internal/ports/http/server.gen.go index 0c5099c..29a73b7 100644 --- a/internal/ports/http/server.gen.go +++ b/internal/ports/http/server.gen.go @@ -59,6 +59,7 @@ type FullIncident struct { Id string `json:"id"` RequestHeaders string `json:"request_headers"` ResolvedAt *time.Time `json:"resolved_at,omitempty"` + ResponseBody string `json:"response_body"` ResponseHeaders string `json:"response_headers"` ResponseStatus int `json:"response_status"` } @@ -446,34 +447,34 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9RZS2/buBb+KwTvBbrRjdzbYlB4NU7tFp5J2yBJMYsgMGjqWGZDkSpJJTUC//cBqffT", - "bm0nMzvLpA4Pv++89YSpjGIpQBiNx09YgY6l0OAeprAiCTczpaSyz1QKA8LYnySOOaPEMCn8b1oK+5+m", - "a4iI/fVfBSs8xv/xS+F+uqp9J+0qOwZvt1sPB6CpYrEVhsd4gkIQoBhFYLciVe71sjOcdu8VEAMTSmUi", - "zBV8T0A71WIlY1CGpXcg6fpCkAjss9nEgMdYG8VEiLcehogw3rkSE60fpQo6FrceVvA9YQoCPL6tH5KL", - "rAi423qZup+kYMbev0ddugZ6v2DCgHogfMHEQgOVInCLERMsSiI8fjPyco3s1hCUu4kIYsmEWSSK79a5", - "ttsbONgqPwuYOUj159W2ZmItRSG357rdubcQTbSRUWZ6VAaAdELXiGj0ytFqz0o0vMJe22Ai0JqE0BY9", - "QZVnRJYyMcisIT2lLal592xXLv6ueEEuvwE19ugPCedzQVmQ+yfnX1Z4fDvsi8UbW68JkkppXqyBBKB0", - "p4PknrnfJm2ISTqNoXHflti2EK+lXxsUawkfwUw4zyz3fDMPLsmGSxK0jSIgZmfoyuS0FHbvto7TO89i", - "BiK996HFBYlSZJMGqBC6ncuuLFxM6lkHteh/20hDePn6SqqImHTLb2+xt4s/J7hyRk2dunSvhl1ujueb", - "g6mq+cMQX0VUSw3shkVwbYg5EnlNsW0WB1S7VHLFOEzBEMb1QXB81TBgttXA0YjpJNHdadNFYAh6oreH", - "qUt3wYLUTSggBv5nmEuTrXdY0BdBJH/4KVmNm7LA5gx3l7rmNT0tFBcynIteqI28B7E7WaXbCnG9GfMY", - "pUdnrZHHjENz9K+QuCOv97LMMiPUeztXJXu1QiPTi1KRuHLgUkoORGR7YmsTQfcyJ9oscmM5zPQa1UtD", - "uaomVRyGypyW4bYiTVecgP1pVBAyKTqZeiA8gT3yeLrPSw8uJFplb2QY8rwWvrQ37/WRuBGBCoJaScfu", - "s8JdrGtb/q+Ycq9/rpjSAz1Fj4k7i+p9SUkOu/3d2VPl+KrUsvN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jluG2Ik1XnID9aZQQUsE7mXogLIE98nq6z0kPLiQaZa9FGLK8er4wN+/1kbgR", + "gQqCWknH7DPCbaxrW/7PmHKvf66oVANdSI+JW4vqfUkKBrv93dpT5fiq1LJXsbIaNmL6LfATSfXmynhQ", + "issZEAlymui1eVrapw85On/9c42zLs1ib1dLpNZax2nPB981SE7YTPiqXTCbfWriuiHV62Q58kXkrph4", + "9O/cQCxBRoRz93I+nX2ajyJzPRs59nkrjRsrkbezxNeVuGpgiigXI39NeEg4/TM0C0YSbvWps1zmK4WW", + "xL8DbjRh1Ies60h5w58W1z+ioXu+eD//fGUvZsIUyEh9WV2BfKA+7HlJB2uqjW3gUmyp4gNIlV5hPBqP", + "XptTRAycxBRP8JvRePTGZge9tsS4WXOr3DitLsyfIVjYjLvYGcAiwJN2AVIpwq2o38fjo40RequdjonC", + "l79T9uw0o09woalbG3tUncD2U1Xzv7nd3jpYJVFE5CZFAAWpOpUuL1Fg+kopgWu2QUyEIQSIWppIqIyP", + "ZlMMlTqdSxK9LnC3kUmoDsBrE5CywznLurGj4Nw5ZdnWY4yWCWxbXL9uu/X7y/n0ej47kI0C7lQ3hQji", + "8IhIgUOBqiGpgigTIeX9cJ7b5dPAWCvr9oJvfNyzB9zjavHx83yGvl4ci5dzETbMuySiKFbcp/znYrYd", + "iillj7eY2cAkSQTaDhNunrAh1AYr7OQBt5SLmzA7FciaWfP2tNGqu1V96WhFOMrhQssNsrVCztqiqCtT", + "6qJsSjFEVmWY0cPVfQJyU5KV9fsljMWQ83XX2KBbCKMR1XUp5HsmZTx2hmWemPeO8c6Lk84YyslElCOC", + "Hqleo5iElNtbVoygYNMUykNpKO8gT5mGGiPol01D+yKeqp4lqahAqQPgqpO5T9mvLDoGwCDtxurgz+z/", + "Jfi7w2Mh98Do+LYN7Gx+Pn8+YNOrD0Pq9EaqcsQ7e1bYThRc/lNJ5bjxpd37n5qw48ev/vnFXkGsw9ee", + "jVGrLRISJdyOTGxPs8Pp4qSDx8pHxP8fgR1fQPcv41+IOaMzIjlXrfpuj8zjKk0qyti512D91/dx5ISE", + "99SEkvAQPMq9gGwU7hDwbBXgrg9GLx2ujT9bniszi1w2yiedHTZjz5EPOaHlhGviukz4hK2F0pN343dj", + "vL3d/hsAAP//5VqQiGoiAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/tests/client/client.gen.go b/tests/client/client.gen.go index 3eeb3a1..a74cd93 100644 --- a/tests/client/client.gen.go +++ b/tests/client/client.gen.go @@ -61,6 +61,7 @@ type FullIncident struct { Id string `json:"id"` RequestHeaders string `json:"request_headers"` ResolvedAt *time.Time `json:"resolved_at,omitempty"` + ResponseBody string `json:"response_body"` ResponseHeaders string `json:"response_headers"` ResponseStatus int `json:"response_status"` } @@ -1755,34 +1756,34 @@ func ParseGetMonitorResponseTimeStatsResponse(rsp *http.Response) (*GetMonitorRe // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9RZS2/buBb+KwTvBbrRjdzbYlB4NU7tFp5J2yBJMYsgMGjqWGZDkSpJJTUC//cBqffT", - "bm0nMzvLpA4Pv++89YSpjGIpQBiNx09YgY6l0OAeprAiCTczpaSyz1QKA8LYnySOOaPEMCn8b1oK+5+m", - "a4iI/fVfBSs8xv/xS+F+uqp9J+0qOwZvt1sPB6CpYrEVhsd4gkIQoBhFYLciVe71sjOcdu8VEAMTSmUi", - "zBV8T0A71WIlY1CGpXcg6fpCkAjss9nEgMdYG8VEiLcehogw3rkSE60fpQo6FrceVvA9YQoCPL6tH5KL", - "rAi423qZup+kYMbev0ddugZ6v2DCgHogfMHEQgOVInCLERMsSiI8fjPyco3s1hCUu4kIYsmEWSSK79a5", - "ttsbONgqPwuYOUj159W2ZmItRSG357rdubcQTbSRUWZ6VAaAdELXiGj0ytFqz0o0vMJe22Ai0JqE0BY9", - "QZVnRJYyMcisIT2lLal592xXLv6ueEEuvwE19ugPCedzQVmQ+yfnX1Z4fDvsi8UbW68JkkppXqyBBKB0",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BU4q8RUeiVpdWclSh4hZ22wUSgFAmhLXqK", + "Ks+ILEWikV5DekpbUvPu2a5c/G3xglh+A1+boz8kjC24T4PcPxn7ssKTm2FfLN7YOk2QZEqztwYSgFSd", + "DpJ7prcUwWZ4x15ilCY66TSXBiItsW0hTe2c1o3aMBrb+Qh6ylhm62ebRXBBNkyQoG1GAdE7g10mp3UB", + "+27rOLXzLKohUnsfWlyQSEk2aUgLodsdzYpno1jPOkiv/20tNGHl6yshI6LTLX+8xc4uPq3gyhk1derS", + "nRp2uQGfbQ6mquZBQ3wVcTA1r2sawZUm+kjkNcW2WRxQ7UKKFWUwA00oUwfB8VXBgNlWQ00jC5BEdSda", + "G7Mh6In3DvZtggw8UjehgGj4TVObWFvv0KAvogj28EOyGjelgcky9i51zWt6GijORbjgvVBrcQd8d3pL", + "txXienPsMYqVzuokjxmHZvWfIXFHJdDLMs2MUO3tXJV81wqNVHmlInHlwKUQDAjP9sTGJoLuZUaU9nJj", + "Ocz0GvVOQ7mqJlUchgqjluG2Ik1XnID9aZQQUsE7mXogLIE98nq6z0kPLiQaZa9FGLK8er4wN+/1kbgR", + "gQqCWknH7DPCbaxrW/7PmHKvf66oVANdSI+JW4vqfUkKBrv93dpT5fiq1LJXsbIaNmL6LfATSfXmynhQ", + "issZEAlymui1eVrapw85On/9c42zLs1ib1dLpNZax2nPB981SE7YTPiqXTCbfWriuiHV62Q58kXkrph4", + "9O/cQCxBRoRz93I+nX2ajyJzPRs59nkrjRsrkbezxNeVuGpgiigXI39NeEg4/TM0C0YSbvWps1zmK4WW", + "xL8DbjRh1Ies60h5w58W1z+ioXu+eD//fGUvZsIUyEh9WV2BfKA+7HlJB2uqjW3gUmyp4gNIlV5hPBqP", + "XptTRAycxBRP8JvRePTGZge9tsS4WXOr3DitLsyfIVjYjLvYGcAiwJN2AVIpwq2o38fjo40RequdjonC", + "l79T9uw0o09woalbG3tUncD2U1Xzv7nd3jpYJVFE5CZFAAWpOpUuL1Fg+kopgWu2QUyEIQSIWppIqIyP", + "ZlMMlTqdSxK9LnC3kUmoDsBrE5CywznLurGj4Nw5ZdnWY4yWCWxbXL9uu/X7y/n0ej47kI0C7lQ3hQji", + "8IhIgUOBqiGpgigTIeX9cJ7b5dPAWCvr9oJvfNyzB9zjavHx83yGvl4ci5dzETbMuySiKFbcp/znYrYd", + "iillj7eY2cAkSQTaDhNunrAh1AYr7OQBt5SLmzA7FciaWfP2tNGqu1V96WhFOMrhQssNsrVCztqiqCtT", + "6qJsSjFEVmWY0cPVfQJyU5KV9fsljMWQ83XX2KBbCKMR1XUp5HsmZTx2hmWemPeO8c6Lk84YyslElCOC", + "Hqleo5iElNtbVoygYNMUykNpKO8gT5mGGiPol01D+yKeqp4lqahAqQPgqpO5T9mvLDoGwCDtxurgz+z/", + "Jfi7w2Mh98Do+LYN7Gx+Pn8+YNOrD0Pq9EaqcsQ7e1bYThRc/lNJ5bjxpd37n5qw48ev/vnFXkGsw9ee", + "jVGrLRISJdyOTGxPs8Pp4qSDx8pHxP8fgR1fQPcv41+IOaMzIjlXrfpuj8zjKk0qyti512D91/dx5ISE", + "99SEkvAQPMq9gGwU7hDwbBXgrg9GLx2ujT9bniszi1w2yiedHTZjz5EPOaHlhGviukz4hK2F0pN343dj", + "vL3d/hsAAP//5VqQiGoiAAA=", } // GetSwagger returns the content of the embedded swagger specification file