Closed vadi2 closed 1 year ago
Hi @vadi2. Thanks for reporting this.
Just so I'm clear... Are you saying that there was a file whose contents were as above (a top-level array containing a resource)? Assuming that's the case, then this is as expected. As it turns out, when you recursively scan a folder like the output
of the IG Publisher, there are a fair number of JSON/XML files that are not resources. Rather than issue a warning or error for every JSON/XML that's not a resource, we simply skip them -- because we expect there to be some non-FHIR JSONs, and that's OK!
It would be difficult for us to analyze an invalid FHIR JSON and determine if it's supposed to be a FHIR JSON or if it's some other random JSON. So I'm not sure there is much we can do here.
That said, if you run GoFSH with debugging on (-l debug
), you'll see a debug log statement for every JSON that GoFSH skips (which should include the filename for the file with the invalid FHIR JSON above).
Are you saying that there was a file whose contents were as above (a top-level array containing a resource)?
Yup.
output of the IG Publisher, there are a fair number of JSON/XML files that are not resources.
Ahh... that make sense. Though I first tried this in fshonline and it has the same behaviour, yet in that context the IG publisher is not involved. Maybe for the online case - that runs in a different context - the behaviour could be better?
I used the IG Publisher's output
folder as an example, but we've run into this in other cases as well... So we don't try to change the behavior based on whether or not we think the IG Publisher is involved.
That said, you're right that FSH Online is a rather special use case, and we should expect that it would always pass in valid FHIR (or something that is supposed to be valid FHIR) -- so we'll see if we can handle that a little better there.
I came across an invalid FHIR example where the resource was inside an array, and gofsh wasn't giving any obvious pushback on it. I found the issue quickly enough, but should the tool also raise any warnings/errors?
The example was structured like so: