FHIR / FHIR/sushi

SUSHI should (maybe) warn or error when people use `.value` on primitives

Open
#598 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
188
Forks
64
Avg merge
8d 21h
Merged PRs (30d)
4

Description

For example, if a user does:

```
Instance: MyPatient
InstanceOf: Patient
* address[0].line[0].value = "123 Easy Street"
```

Sushi does not complain, but it creates a weird instance:
```
{
"resourceType": "Patient",
"id": "MyPatient",
"address": [
{
"_line": [
{
"value": "123 Easy Street"
}
]
}
]
}
```

I suspect this is because `line` is a `string`, and the _formal_ definition of `string` _does_ have a `value` property (it's just supposed to be implicit in the JSON serialization).

If a user does this, SUSHI should either:
* emit a warning but render the JSON _correctly_
* or emit an error

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.