[!IMPORTANT]
Do not merge this until #2705 is merged.
[!NOTE]
This PR is for the sake of exploring an Express server generated by the OpenAPI Generator. The preferred approach to quickly migrate MODEL-AD REST API to this repo would be to copy the existing MODEL-AD Express server code as is to the project model-ad-api. If the MODEL-AD team decides to adopt specification-first development for this API, then I would recommend selecting one of the two languages and frameworks already used in this repo to align and speedup backend development, namely Java-Spring (e.g., openchallenges-challenge-service) or Python-Flask (schematic-api). @JessterB @hallieswan @sagely1
Description
This PR explores the Express server generated by the OpenAPI Generator (MODEL-AD currently uses an Express server).
The only Express REST API server available is in Beta (nodejs-express-server).
Preview
Generate the API server stub
nx run model-ad-api:generate
Run the API server
nx serve model-ad-api
Access list of genes
The API includes a single endpoint to get a list of genes, which should return an empty array at this point.
$ curl -X GET -H "Content-type: application/json" \
-H "Accept: application/json" \
"http://localhost:8080/v1/genes" | jq .
{
"message": "request should have required property 'headers'",
"errors": [
{
"path": ".headers",
"message": "should have required property 'headers'",
"errorCode": "required.openapi.validation"
}
]
}
[!NOTE]
A quick search online shows that upgrading express-openapi-validator from v3 to v4 solved this issue in some cases. I tried to simply upgrade to ^4.0.0 and ^5.0.0 but without success (server fails to start).
Description
This PR explores the Express server generated by the OpenAPI Generator (MODEL-AD currently uses an Express server).
References
nodejs-express-server
).Preview
Generate the API server stub
Run the API server
Access list of genes
The API includes a single endpoint to get a list of genes, which should return an empty array at this point.