Skip to content
Discussion options

You must be logged in to vote

You should add that message property both into positive schema and handler implementation (where you do .json()), @marcelmatko

Since data technically can be anything object-based, your implementation would need to ensure the presence of the message prop within data in order to pull it on top.

if (data && "message" in data && typeof data.message === "string") {
  // ...
}

Schemas are used by Documentation and Integration generators, and they also enforce the constraints on .json() within handler.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@marcelmatko
Comment options

@RobinTail
Comment options

@RobinTail
Comment options

@marcelmatko
Comment options

Answer selected by RobinTail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants