tableschema-java icon indicating copy to clipboard operation
tableschema-java copied to clipboard

No setter for Constraints in Field class?

Open vincentmarinelli-wk opened this issue 2 years ago • 1 comments

Overview

(@iSnow @JohannesJander ) I'm wondering why there is a getter but no setter for Constraints in the Field abstract class: https://github.com/frictionlessdata/tableschema-java/blob/25f931cd3b6925fd1d4d47a156918c35304232b1/src/main/java/io/frictionlessdata/tableschema/field/Field.java#L558

Is there another way that we should be setting field-level constraints when creating a schema in Java code?

If this is an oversight, I'd be happy to create a PR to add the setter.


Please preserve this line to notify @iSnow (lead of this repository)

vincentmarinelli-wk avatar May 23 '23 13:05 vincentmarinelli-wk

@vincentmarinelli-wk the constraints are parameters in the constructor.

Usually, the idea is that client code wouldn't directly manipulate Fields, but they would be created from the CSV and Schema, and so the constraints would be declared in the Schema.

What specific use-case do you have that needs programmatic setting of constraints on Fields?

iSnow avatar Sep 05 '23 23:09 iSnow