Skip to content

tableSchemaFieldString should require type; tableSchemaFieldAny should not #1147

Description

@signekb

What Data Package version are you using?

V2

Describe the Bug

In profiles/dictionary/schema.yaml, the required arrays for tableSchemaFieldString and tableSchemaFieldAny are inverted relative to what is described textually in the spec.

The spec states that "the absence of a type property indicates that the field is of the type any".

This means any should be the implicit default when type is omitted, and string should require an explicit type: "string" to be selected. However, the schema currently has:

  • tableSchemaFieldString: required: [name], meaning that type is optional and a field with no type {"name": "foo"}
    matches a string field

tableSchemaFieldString:
type: object
title: String Field
description: The field contains strings, that is, sequences of characters.
required:
- name
properties:

  • tableSchemaFieldAny: required: [name, type], meaning that type is mandatory, so a field with no type {"name": "foo"}
    cannot match an "any" field

tableSchemaFieldAny:
type: object
title: Any Field
description: Any value is accepted, including values that are not captured by
the type/format/constraint requirements of the specification.
required:
- name
- type
properties:

Proposed fix

  • Add type to required in tableSchemaFieldString (consistent with the other fields)
  • Remove type from required in tableSchemaFieldAny

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions