ahl,
@ahl@mastodon.social avatar

What is the point of json schema validation in a typed language? I get if for JavaScript: does this untyped blob conform to what I expect? But in a typed language I’d expect to deserialize into typed structures and do validation as part of that deserialization. Is there some utility of validation there?

acdha,
@acdha@code4lib.social avatar

@ahl you can do validation early (e.g. Cloudflare will do it again the edge https://developers.cloudflare.com/api-shield/security/schema-validation/), you can autogenerate clients for other languages or IDE support, tools like https://pypi.org/project/schemathesis/ work portably, you can reference shared scheme definitions, etc.

One way to avoid duplication would be to have your API library generate schemas from your models so you work with typed, validated requests but can offer consumers schema-based tools.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • InstantRegret
  • ngwrru68w68
  • everett
  • mdbf
  • modclub
  • rosin
  • khanakhh
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • Youngstown
  • GTA5RPClips
  • slotface
  • kavyap
  • JUstTest
  • ethstaker
  • osvaldo12
  • normalnudes
  • tacticalgear
  • cisconetworking
  • cubers
  • Durango
  • Leos
  • anitta
  • tester
  • megavids
  • provamag3
  • lostlight
  • All magazines