-
Notifications
You must be signed in to change notification settings - Fork 0
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
HTTP interceptor strict JSON validation #106
Comments
Migration guideIn order to keep compatibility with client code bases with minimal changes, I'm proposing a new utility typed exported by
|
### Features - [#zimic] Added the utility types `JSONCompatible` and `JSONSerialized`. - [#zimic] Added strict JSON validation to interceptor schemas. Since this is a breaking change, see the [Migration guide](#106 (comment)) to enable the strict validation! Closes #106.
As of v0.2.x, JSON bodies are not completely statically validated. This allows defining bodies using non-JSON values, such as
Date
andError
.This issue means to add strict JSON validation to interceptor declarations. Unfortunately, it won't be possible to declare body types using raw TypeScript
interface
's, because they do not have automatic index signatures astype
's. See microsoft/TypeScript#15300 for more information.microsoft/TypeScript#1897 proposes a native
json
type, which might help in the future. Right now, though, theinterface
vstype
problem seems unsolvable natively.The text was updated successfully, but these errors were encountered: