Skip to content

Commit

Permalink
Error msg for missing 'resourceType' property (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbhutad authored May 17, 2024
1 parent 8f80cc1 commit 1a0c465
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/components/FSHControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ export default function FSHControls(props) {
setIsGoFSHRunning(true);
const gofshInputStrings = props.gofshText.map((def) => def.def).filter((d) => d);
const parsedDependencies = dependencies === '' ? [] : dependencies.split(',');

// Create small ImplementationGuide resource to send canonical and version information
if (canonical || version || fhirVersion !== '') {
const igResource = {
Expand Down
3 changes: 3 additions & 0 deletions src/utils/FSHHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export async function runGoFSH(input, options) {
const location = `Input_${i}`;
try {
resource = JSON.parse(resource);
if (!resource.resourceType) {
logger.error(`FHIR JSON ${resource.id ?? location} is missing the required "resourceType" property`);
}
} catch (e) {
logger.error(`Could not parse ${location} to JSON`);
return;
Expand Down

0 comments on commit 1a0c465

Please sign in to comment.