Declaratively imposing constraints using ValueConstraints.jl

07/28/2023, 8:20 PM — 8:30 PM UTC
32-144

Abstract:

ValueConstraints.jl provides a framework for declaratively expressing constraints on values, e.g. "minimum", "maximum", "needs to be within this set", etc. along with a small standard library of common constraints. It is fast, i.e. on par with using regular function calls, provides friendly error messages and warnings, and, perhaps most importantly, can serve as a foundation for the creation of schemas.

Description:

The need to be able to express constraints on data is common in various aspects of software engineering. A particular example that might come to mind is API design, especially inter-process API design, where it is useful to be able to make expose these constraints to consumers of the API. For instance, the OpenAPI specification is a specification for REST APIs and is in turn an extension of the JSON Schema specification. The OpenAPI specification leverages the JSON Schema Validation specification to document constraints on data submitted to API endpoints.

Although the Julia ecosystem has packages that handle the parsing of these types of schemas, such as JSONSchema.jl or OpenAPI.jl, there is no such package making it easy to generate these types of schemas from Julia code. ValueConstraints.jl aims to fill that gap. It takes a declarative and introspectable approach to expressing constraints on values, so that other packages like StructTypes.jl can be used to serialize the constraints into and from formats such as JSON Schema.

Platinum sponsors

JuliaHub

Gold sponsors

ASML

Silver sponsors

Pumas AIQuEra Computing Inc.Relational AIJeffrey Sarnoff

Bronze sponsors

Jolin.ioBeacon BiosignalsMIT CSAILBoeing

Academic partners

NAWA

Local partners

Postmates

Fiscal Sponsor

NumFOCUS