• 0 Posts
  • 21 Comments
Joined 1 year ago
cake
Cake day: July 3rd, 2023

help-circle


  • https://curl.se/ has been account free since 1998.

    Never understood why people keep trying to use proprietary tools for this, especially when curl is so good.

    I have a directory of shell scripts I use to test out endpoints. I persist request/response data either with environment variables or regular files. Oh and since these are just shell scripts, it’s pretty trivial to do stuff like iterate over a CSV (or JSON array) and make a request for each row, conditionally make requests, or whatever else you want.

    Oh and honorable mention goes to jo and jq for making it super easy to make/process JSON data.






  • I understand what you’re saying—I’m saying that data validation is precisely the purpose of parsers (or deserialization) in statically-typed languages. Type-checking is data validation, and parsing is the process of turning untyped, unvalidated data into typed, validated data. And, what’s more, is that you can often get this functionality for free without having to write any code other than your type (if the validation is simple enough, anyway). Pydantic exists to solve a problem of Python’s own making and to reproduce what’s standard in statically-typed languages.

    In the case of config files, it’s even possible to do this at compile time, depending on the language. Or in other words, you can statically guarantee that a config file exists at a particular location and deserialize it/validate it into a native data structure all without ever running your actual program. At my day job, all of our app’s configuration lives in Dhall files which get imported and validated into our codebase as a compile-time step, meaning that misconfiguration is a compiler error.