3 ms·
I have an idea. Why don't we give up on a strictly declarative format/solution? What if, associated with each possible API call, was a pseudocode or generalcode
by kizer 8y ago
I have an idea. Why don't we give up on a strictly declarative format/solution? What if, associated with each possible API call, was a pseudocode or generalcode representation of the code executed to validate the request?
Is reading code snippets that difficult? For a short validation program, a machine could certainly infer if a type would be accepted (just run the validation).
I know that a declarative format seems like the right choice, given validation in mainstream programming languages is expressed declaratively via the type system, but these standards, to me, often seem to only translate awkwardly an implicit validation program into a very verbose declaration.
- Boulth 8y agoThat's a really interesting idea! The language for API validation could be a total programming language [0], something similar to Dhall [1] for configuration. [0]: https://en.m.wikipedia.org/wiki/Total_functional_programming https://en.m.wikipedia.org/wiki/Total_functional_programming [1]: https://github.com/dhall-lang/dhall-lang https://github.com/dhall-lang/dhall-lang
- kizer 8y agoReading up on those now. Thanks for the feedback!