I like this approach a lot. I wonder if it's a good idea to keep the assertions in prod as well. I guess this is a trade-off between safety and convenience.. As a side note, what do people think about JSON schema? I find it quite verbose and cumbersome (compared to, say, typescript type definitions)
Testing in production: using JSON Schema for 3rd party API response validation
21–24 of 24 posts
Re: Testing in production: using JSON Schema for 3rd party API response validation
#22Re: Testing in production: using JSON Schema for 3rd party API response validation
#23Back in the early years of Snowplow, we adopted a similar approach for our support of 3rd party webhooks[1] as an event stream source supported natively by Snowplow ( https://github.com/snowplow/snowplow ). (The important background here is that all events and entities flowing through Snowplow are described using versioned JSON Schema). We built a kind of Maven Central for 3rd party webhooks' schemas[2], and got to w…
Also, if this is a genuinely useful thing to have, you could probably monetize it directly. Decouple the schema repository from your primary application and sell access to well-validated, performant client libraries for popular SaaS APIs.
Re: Testing in production: using JSON Schema for 3rd party API response validation
#24It's a bit of a shallow analysis but I lack experience about this so excuse me in advence. I see more and more people importing a lot of libraries to write Typescript code. Part of it is libaries to do things (like in the article), part of it is libraries to change the language (like fp-ts). In my (limited) experience I saw the same thing with Scala, with people using cats or equivalents. I wonder, does this happen i…