TykTechnologies / tyk-sync

Tyk Sync - move Tyk configurations between multiple environments
Other
65 stars 24 forks source link

Dump command doesn't filter when using the --oas-apis flag #174

Open jonathanfoster opened 1 month ago

jonathanfoster commented 1 month ago

The dump command doesn't filter OAS APIs when using the --oas-apis flag.

$ tyk-sync dump -d $TYK_DASHBOARD_URL -s $TYK_DASHBOARD_SECRET -t apis --oas-apis=3eedb7f953dd427075e996961fc70c38
Extracting APIs, Policies, and Templates from $TYK_DASHBOARD_URL
> Fetching policies
> Fetching APIs
> Fetching templates
--> Cleaning policy objects
--> Fetched 21 Policies
--> Identified 1 OAS APIs
--> Fetched 87 Classic APIs
--> Fetched 12 OAS APIs
--> Fetched 0 Templates
> Creating spec file in: apis/.tyk.json
Done.

It does work when using the --apis flag instead. The downside is it downloads the OAS API in classic API format.

$ tyk-sync dump -d $TYK_DASHBOARD_URL -s $TYK_DASHBOARD_SECRET -t apis --apis=3eedb7f953dd427075e996961fc70c38
Extracting APIs, Policies, and Templates from https://tyk.dev.nexteraenergy.com
--> Fetched 0 Policies
--> Identified 1 APIs
--> Fetching and cleaning APIs objects
--> Fetched 1 Classic APIs
--> Fetched 0 OAS APIs
--> Fetched 0 Templates
> Creating spec file in: apis/.tyk.json
Done.
jonathanfoster commented 1 month ago

Looks like this is caused by not checking wanted OAS APIs here.