Tyk-sync example

Hello,

I’m struggling to use tyk-sync with gitlab, I find the documentation to be kinda short on this.
Since I don’t use a dashboard, I can’t start by a tyk-sync dump and thus I don’t really know what my tyk-sync repository is supposed to look like.

I was under the assumption that the only thing to do was having my api/policies definition in a file named .tyk.json in my gitlab repository. And that a sync command would upload them in my tyk install.
But I get an error saying “Type must be 'apidef or ‘oas’”. My file format is probably wrong, but I don’t what it is supposed to look like. Can anyone provide me with an example ?

Thanks in advance

here is what my json file looks like :

“api_definition”: {
“name”: “myApiName”,
“slug”: “A Super Api”,
“api_id”: “api01”,
“org_id”: “myOrg”,
“auth”: {
“auth_header_name”: “Authorization”
},
“version_data”: {
“not_versioned”: true,
“versions”: {
“Default”: {
“name”: “Default”,
“use_extended_paths”: true
}
}
},
“enable_ip_whitelisting”: false,
“enable_ip_blacklisting”: true,
“enable_batch_request_support”: true,
“proxy”: {
“listen_path”: “/path/”,
“target_url”: “https://my.rest.server.org”,
“preserve_host_header”: true,
“strip_listen_path”: false
},
“active”: true
}
}

Hi Thierry,
did you see https://tyk.io/docs/manage-multiple-environments/tyk-sync/ ?
Maybe you missed this documentation?
Have a successful day!
/mike

Hi,

I did see this page, but I’m still stumped as to what my .tyk.json is supposed to look like.
Maybe it is self evident, but I can’t wrap my head around it :confused:

Have a great day too :slight_smile: