Skip to content

Allowing type duplications is not documented in the spec #716

Open
@tom-tan

Description

@tom-tan

The spec of Apache Avro says:

Unions may not contain more than one schema with the same type, except for the named types record, fixed and enum.

As described in the spec of SALAD, SALAD is based on Apache Avro.

Salad builds on JSON-LD and the Apache Avro data serialization system

Also, there are few descriptions of union types in the spec of SALAD.

Therefore, we expect that union types behave as same as Apache Avro. That is, SALAD does not allow type duplications in union types.
However, schema-salad-tool allows type duplications.

For example:

$graph:
- name: Foo
  type: record
  fields:
    - name: field1
      type: [string, string]
$ schema-salad-tool schema.yml 
/home/vscode/.local/bin/schema-salad-tool Current version: 8.4.20230606143604
Schema 'schema.yml' is valid

Is it an intended behavior?
If intended, it would be nice if it is clarified in the spec of SALAD.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions