CoVital-Project / pulse-ox-data-collection-web-service

HTTPS API for receiving pulse oximetry from mobile clients
https://covital.org
GNU General Public License v3.0
5 stars 4 forks source link

Can't generate dart lib on fedora #64

Closed MalcolmMielle closed 4 years ago

MalcolmMielle commented 4 years ago

Hi all,

On a clean clone of the repo on my Fedora 31 machine I'm hit this error:

$ make dart_client 
env OUTPUT_LANGUAGE=dart ./script/generate-bindings.sh

******************************************************
*
* Building dart client.
*  input schema: reference/pulseox-data-collector.v1.json
*  output folder: clients/dart
*
******************************************************
[error] The spec file is not found: /local/reference/pulseox-data-collector.v1.json
[error] Check the path of the OpenAPI spec and try again.
make: *** [Makefile:4: dart_client] Error 1

Not sure what to do about it since I've never worked with docker before. It seems like the ${PWD} command is not really understood since it stays with a weird local instead of my actual path?

haggy commented 4 years ago

The full command is:

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \
    -i /local/${SCHEMA} \
    -g "${OUTPUT_LANGUAGE}" \
    -o "/local/clients/${OUTPUT_LANGUAGE}"

It's mounting ${PWD} as /local in the container so that the openapi generator can access the spec file. This works on Mac OSX so Im thinking it's a weird docker FS mount issue with Fedora.

As a workaround, can you try installing the generator "directly" using NPM? npm install @openapitools/openapi-generator-cli -g

You can then try to run:

openapi-generator generate \
    -i reference/pulseox-data-collector.v1.json \
    -g dart \
    -o "/clients/dart"
MalcolmMielle commented 4 years ago

That seems to have worked! I've add to do a couple more steps but they were well indicated after (and manually create the folder clients/dart)