common-workflow-language / common-workflow-language/schema_salad
Allowing type duplications is not documented in the spec
- Dominant language
- Python
- Stars
- 86
- Forks
- 64
- Avg merge
- 19h 24m
- Merged PRs (30d)
- 19
Description
The spec of [Apache Avro](https://avro.apache.org/docs/1.11.1/specification/#unions) 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](https://www.commonwl.org/v1.2/SchemaSalad.html#Abstract), 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:
```yaml
$graph:
- name: Foo
type: record
fields:
- name: field1
type: [string, string]
```
```console
$ 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.
Contributor guide
Research direction
Start by comparing the SALAD Abstract and union-type descriptions with the linked Apache Avro unions section. Reproduce the example using schema-salad-tool and inspect how the schema is accepted. Done means the SALAD specification clearly states whether duplicate types in unions are allowed, with behavior matching the documented rule.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100