Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Strict mode #7

Open
mobilars opened this issue Jun 9, 2017 · 2 comments
Open

Strict mode #7

mobilars opened this issue Jun 9, 2017 · 2 comments

Comments

@mobilars
Copy link

mobilars commented Jun 9, 2017

I guess this is a local installation problem here, but I'm using a fresh ubuntu to try to get this working so not sure quite what could be the problem. The google-search says something about adding strict-mode... I had to install nodejs-legacy to get it running, node -v returns version 4.7.2.

/usr/local/lib/node_modules/fhir-swagger/lib/schemas.js:10
for (let key in schema.properties) fixSchema(schema.properties[key]);
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/local/lib/node_modules/fhir-swagger/lib/conformance-to-swagger.js:2:17)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

@mobilars
Copy link
Author

mobilars commented Jun 9, 2017

Actually, it works from Windows, but I'm getting another error. Is this due to some new resources in STU3?

$ fhir-swagger --fhir_url "http://fhirtest.uhn.ca/baseDstu3" --conformance_path="/metadata?_format=application/json" --dstu3 --output swagger.json
Failed to find schema example for ActivityDefinition
Failed to find schema example for AdverseEvent
Failed to find schema example for CapabilityStatement
Failed to find schema example for ChargeItem
Failed to find schema example for CompartmentDefinition
Failed to find schema example for Consent
Failed to find schema example for DeviceRequest
Failed to find schema example for DocumentManifest
Failed to find schema example for Endpoint
Failed to find schema example for GraphDefinition
Failed to find schema example for ImagingManifest
Failed to find schema example for Measure
Failed to find schema example for MeasureReport
Failed to find schema example for MedicationRequest
Failed to find schema example for MessageDefinition
Failed to find schema example for PlanDefinition
Failed to find schema example for RequestGroup
Failed to find schema example for ResearchStudy
Failed to find schema example for ResearchSubject
Failed to find schema example for ServiceDefinition
Failed to find schema example for TestReport

@rbren
Copy link
Owner

rbren commented Jun 14, 2017

Thanks, I've added "use strict" to prevent the first error.

The "Failed to find schema" errors just mean that no JSON Schema was generated for that resource, because there was no example found in ./examples/dstu3. It should still output a Swagger file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants