GoogleCloudPlatform / nodejs-docs-samples

Node.js samples for Google Cloud Platform products.
https://cloud.google.com/nodejs
Apache License 2.0
2.81k stars 1.94k forks source link

Missing header for FHIR examples #3698

Open nate-watkins opened 4 months ago

nate-watkins commented 4 months ago

In which file did you encounter the issue?

healthcare/fhir/createFhirResource.js

Did you change the file? If so, how?

    version: 'v1',
    auth: new google.auth.GoogleAuth({
      scopes: ['https://www.googleapis.com/auth/cloud-platform'],
    }),
    headers: {'Content-Type': 'application/fhir+json'},
+   responseType: 'json',
   }
}

Describe the issue

Line 58 expects the return type to be json. If left unspecified, it returns an array buffer that needs to be converted. This applies to many of the FHIR examples. For others who may come across this, I believe there are other issues with the TS types in the client library.

iennae commented 1 month ago

@nate-watkins Thank you so much for both this issue and the one in the APIs repo. I'll follow up with folks in the Client Libraries team. Appreciate the context that you've shared.