frictionlessdata / datapackage

Data Package is a standard consisting of a set of simple yet extensible specifications to describe datasets, data files and tabular data. It is a data definition language (DDL) and data API that facilitates findability, accessibility, interoperability, and reusability (FAIR) of data.
https://datapackage.org
The Unlicense
488 stars 112 forks source link

Difference beteween standard and JSON schema (fieldsMatch) #965

Open dtemkin-volpe opened 2 months ago

dtemkin-volpe commented 2 months ago

In the Table Schema documentation, fieldsMatch is described as "MUST be a string with the following possible values and the exact value by default".

However, in the JSON schema for the Table Schema, fieldsMatch is typed as an array as follows:

"fieldsMatch": {
            "type": "array",
            "item": {
                "type": "string",
                "enum": [
                    "exact",
                    "equal",
                    "subset",
                    "superset",
                    "partial"
                ],
                "default": "exact"
            }
        }

It seems to me like the standard describes fieldMatch as a string, but the JSON schema describes it as an array with a singular string item? I'm not really sure which one to follow (or if this is actually an issue, maybe I'm just reading everything wrong), so let me know. Thanks!

peterdesmet commented 2 weeks ago

Thanks for reporting, that seems to be an error in the JSON schema. fieldMatch needs to be a string, with an enum of possible values.

@roll I think this needs to be updated to:

 tableSchemaFieldsMatch: 
   type: string # <-- updated
   item: # <-- no need to define type here
     enum:
       - exact 
       - equal 
       - subset 
       - superset 
       - partial 
     default: exact 

That is similar to itemType:

https://github.com/frictionlessdata/datapackage/blob/cc20b49812451ee2dcc36a9a840363f8aeb0cc92/profiles/source/dictionary/schema.yaml#L1094-L1105