Sushi examples should preserve the order of fields in the output
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 188
- Forks
- 65
- Avg merge
- 8d 11h
- Merged PRs (30d)
- 3
Description
Example resources can be difficult for users to inspect and understand since the fields are produced in a surprising order. Here's a minimal example of a simple patient -- notice the `active` and `gender` fields are moved to the bottom of the generated resource:
```
Instance: SimplePatient
InstanceOf: Patient
* active = true
* gender = #female
* address[+]
* use = #work
* address[+]
* use = #home
```
And the example output:
```
{
"resourceType": "Patient",
"id": "SimplePatient",
"address": [
{
"use": "work"
},
{
"use": "home"
}
],
"active": true,
"gender": "female"
}
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the compiler turns the shown FSH patient example into a JSON resource, then locate the serialization or resource-generation tests. Preserve the input field order in the generated output and add a regression case based on this example that verifies active and gender remain before the address fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100