I have 2 API's I need to integrate my flutter application with, both have swagger and both i generate with OpenAPI. I have one generated code in api
folder the other in api2
.
Now my pubspec.yaml can handle only 1 path for the generated code like below:
openapi:
path: ./api/
How would i add a second path?
This wouldn't work due to uniqueness:
openapi:
path: ./api/
path: ./api2/
Can i do it like:
openapi_01:
path: ./api/
openapi_02:
path: ./api2/
And inside the pubspec.yaml of each i define the identifier? like below:
name: openapi_01
version: 1.0.0
description: OpenAPI API client
homepage: homepage
I found the fix.
I use a bash script to generate the openapi folder, and now i have added additional properties to rename it:
This will generate the file and the library in a format i need it like
pubspec_name_here.dart
as i needed.