fhir-swagger icon indicating copy to clipboard operation
fhir-swagger copied to clipboard

Strict mode

Open mobilars opened this issue 8 years ago • 2 comments

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 avatar Jun 09 '17 08:06 mobilars

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

mobilars avatar Jun 09 '17 20:06 mobilars

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.

rbren avatar Jun 14 '17 21:06 rbren