Menu

Post image 1
Post image 2
1 / 2
0

Computed business rules in Okyline: what JSON Schema cannot validate

DEV Community·Pierre-Michel Bret·18 days ago
#RH4oDvhy
Reading 0:00
15s threshold

In the first article of this series, we introduced Okyline with an e-commerce order. In the second , we added conditional logic on a hotel reservation. This time, we're tackling something different: validating that computed values in your payload are actually correct . The goal is to validate the business invariants that depend solely on the data to be validated. Think about it. Does lineTotal really equal quantity × unitPrice ? Does totalAmount match the sum of all line totals with tax applied? Every invoice system has these rules, but they almost never live in the data contract. They end up as handwritten checks buried in the code, duplicated across services, and nobody remembers which version is the right one. Okyline has $compute . The starting point Back to e-commerce.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More