This specification describes the Jiskefet REST API. The spec was generated using the NestJS Swagger module.
- Deploy the server using https://github.com/SoftwareForScience/jiskefet-deploy
- Go to the spec endpoint, e.g. https://my.server.address/api/doc-json
- Plug the output into https://editor.swagger.io/ and use it to convert to YAML
- Make some manual changes: see [Caveats]
- Plug the updated output into https://editor.swagger.io/
- Click "Generate Client" -> "Go"
Due to a bug in the NestJS Swagger module, the generated spec contains some incorrect lines. For more information: nestjs/swagger#149
To fix it, run this command:
# On Linux
sed -i '/isArray: false/d' ./openapi-spec.yaml
# On OSX
sed -i .bak '/isArray: false/d' ./openapi-spec.yaml
The NodeJS generation also contains errors due to incomplete/incorrect decorators in the back-end code. The following are known issues:
- Some endpoints (such as
runs/get,logs/get) don't provide a schema for the response. - The response specification of
runs/postdoes not match what's provided by the server. - Various numbers (such as IDs and counters) that should be specified as
type: integerwithformat: int64, are instead specified astype: number, which is interpreted as a floating point by the client code generator. - In
runs/getactivityId is specified withformat: date-time(it should have no format). - Some parameters that should be int64s, are specified as strings (such as the pageSize, pageNumber and runNumber of
runs/get) - There are references to non-functional Date definition in several places.
These should simply be either
type: stringwithformat: date-time, or a functioning Date definition. - Various user & auth related issues. The affected endpoints are currently not used by the C++/Go clients, fortunately.
- In some places, instead of an int64 integer ID,
type: useris specified, which is not a valid type. - The endpoint
/users/{id}/tokensdoes not list a parameter for the ID, making it unusable. - In some places,
type: ''is specified, which is not a valid type. These should probably betype: string
- In some places, instead of an int64 integer ID,