Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

feat: encode ws messages to json so they become machine-readable #28

Merged

Conversation

smoya
Copy link
Collaborator

@smoya smoya commented Aug 16, 2021

Description

This PR changes the way validation errors are encoded and then sent to the WS connection. In particular, it encodes each WS message to JSON so it can become machine-readable. This is useful for automating end-to-end tests on real infrastructure.

An example of an encoded WS message (formatted):

{
    "ts": "2021-08-16T12:36:12.025941+02:00",
    "msg": {
        "context": {
            "channel": "demo"
        },
        "key": "c21veWEtd2FzLWhlcmU=",
        "value": "eyJjb21tYW5kIjogMX0="
    },
    "errors": [
        "command: Invalid type. Expected: string, given: integer"
    ]
}

Related issue(s)
#23

@smoya smoya added the enhancement New feature or request label Aug 16, 2021
@smoya smoya force-pushed the feat/machine-readable-logs branch from d830016 to 7c3ed25 Compare August 16, 2021 11:03
@@ -50,7 +50,6 @@ func main() {
})

r := chi.NewRouter()
r.Get("/", http.FileServer(http.Dir("./web/static")).ServeHTTP)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't suppose to be there 😅

@smoya smoya merged commit 117af93 into asyncapi-archived-repos:master Aug 19, 2021
@smoya smoya deleted the feat/machine-readable-logs branch August 19, 2021 21:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants