Datatypes which match the ones used at our API. Only consumed or produced datatypes are generated
For example, the 'Client:IdentityUser' class does not show up, since it's only ever seen by the BackEnd
'Service' classes, which contain static functions for calling our endpoints
They contain all the parameters available, are cancelable, and contain documentation with the consume, response, errors and endpoint descriptions
To fetch data, we simply call those static methods. It's extremelly useful
NOTE: The GitHub Action isn't running the generation!. Thus, theres a chance the developer might make Pull Requests with changes to the Models/Endpoints in the BackEnd without running the OpenAPI Generation files
This has definelly to be addressed
Using OpenAPI Generator to create Client SDK
First, we generate the swagger.json. At the 'Server' folder, run:
To install the Dotnet project's dependencies
dotnet restore
To build a Release version of the dotnet project
dotnet build -c Release .\FixFlowServer.csproj
To generate the swagger.json file
swagger tofile --output swagger.json .\bin\Release\net8.0\FixFlow.Server.dll v1
The swagger file is the one you see at SwaggerUI, and must be generated AFTER the build, or it won't pick-up on any changes
Now we must generate the Client SDK code, specifically from within the 'src' folder, or it won't be spottable there
openapi -i ..\..\FixFlow.Server\swagger.json -o FlowApi -c axios
That will generate:
Datatypes which match the ones used at our API. Only consumed or produced datatypes are generated
'Service' classes, which contain static functions for calling our endpoints
NOTE: The GitHub Action isn't running the generation!. Thus, theres a chance the developer might make Pull Requests with changes to the Models/Endpoints in the BackEnd without running the OpenAPI Generation files This has definelly to be addressed