In my NextJS project, we utilize the /api path to implement our API, with an openapi.yaml file defining the interface. To generate the API client successfully, we run the following command:
openapi-generator-cli generate -i data/api/openapi.yaml -o src/api/openapi -g typescript-fetch
Currently, I am attempting to create the stubs for implementing the server side of the API (to be called under the /api path). However, when I try the following command, it results in an error:
openapi-generator-cli generate -i data/api/openapi.yaml -o src/api/openapi -g next
The error arises because it cannot locate a 'next' generator:
Can't load config class with name 'next' Available: ... and here is a list of available generators
I have noticed that there is a typescript-node generator but my project specifically uses Next.JS instead of plain node. Is there a method to repurpose the node generator or another solution?