Add context to coerce and validation funcs?
See original GitHub issueI’m producing some types for data that’s gonna get stored in dynamodb. It basically means having a handful of generated hash and sort keys, that are constructed from numerous concatenated properties on the object. (E.G. series|[seriesId]|book|[bookId]
). So my coercion and validation funcs would benefit from having access to the complete object to compare the key to the properties it leverages.
Do you see an easy way to do this as is? Or is this a good feature request?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Gin binding in Go: A tutorial with examples - LogRocket Blog
This tutorial covers Gin binding in Go, various built-in validators, custom binding using interfaces provided by the Gin library, and more.
Read more >7. Validation Functions - CouchDB: The Definitive Guide [Book]
CouchDB sends functions and documents to a JavaScript interpreter. This mechanism is what allows us to write our document validation functions in JavaScript....
Read more >Cool Things You Can Do With Pydantic | by Gideon Caller
Pydantic is a useful library for data parsing and validation. It coerces input types to the declared type (using type hints), ...
Read more >Azure Functions HTTP trigger | Microsoft Learn
The HTTP trigger lets you invoke a function with an HTTP request. You can use an HTTP trigger to build serverless APIs and...
Read more >The Data Validation Cookbook
We first load the package, and create a list of data quality demands with the validator() function. library(validate) rules ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Added in
0.13.0
!Absolutely!
I figured the mock idea was just experimentation, it’s an interesting concept too. I thought about it but the part I always get stuck on is that (a) the built-in mocks for data types like string/number will never be very accurate which leads to wanting to define built-ins for emails, urls, domains, uuids, etc., and (b) that it becomes harder to get the mock to stay accurate as extensions are made to structs. But if you end up figuring out a good way to do this I’d love to hear it!