common-workflow-language / common-workflow-language/schema_salad

`--print-pre` inserts an identifier field of other unused type

Open
#397 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
86
Forks
64
Avg merge
19h 24m
Merged PRs (30d)
19

Description

I could not find descriptions that support this behavior.
Is it a bug of schema-salad-tool or an undocumented specification, or am I missing something?

# Input schema and document to be preprocessed

- schema.json
```json
{
"$namespaces": {
"acid": "http://example.com/acid#"
},
"$graph": [
{
"name": "RootType",
"type": "record",
"documentRoot": true,
"fields": [
{
"name": "id",
"type": "string"
}
]
},
{
"name": "UnusedType",
"type": "record",
"fields": [
{
"name": "unused_id",
"type": "string",
"jsonldPredicate": "@id"
}
]
}
]
}
```

- example.json
```json
{
"id": "foo"
}
```
# How to reproduce
```console
$ schema-salad-tool --print-pre schema.json example.json
```

# Expected behavior
Input document is printed as a preprocessed document.
```console
$ schema-salad-tool --print-pre schema.json example.json
...
{
"id": "foo"
}
```

# Actual behavior
Input document with `unused_id` field is printed as a preprocessed document.
```console
$ schema-salad-tool --print-pre schema.json example.json
...
{
"id": "foo",
"unused_id": "file:///home/tom-tan/example/example.json"
}
```

# Version
```console
$ schema-salad-tool --version
/home/tom-tan/.local/bin/schema-salad-tool Current version: 7.1.20210518142926
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.