How to convert swagger open specs file using tyk sync

Hi,

We are using tyk gateway CE and we would like to know if it’s possible to convert open api specs file to api definition using tyk sync.

They mentioned this in the github document but I don’t see any example on how to do it.

Thanks,

Rudy

Hi,
It’s the .tyk.json file that tells tyk-sync to use either tyk’s API definition format or oas.

Here’s the contents of a .tyk.json that I’ve used to publish openstack/swagger/identity.json from Sample Swagger files

{
  "type": "oas",
  "files": [
    {
      "file": "identity.json",
      "oas": {}
    }
  ]
}

tyk-sync will then be able to use that to upload the definition.

Cheers,
Pete

Thanks Pete, following your file format, I am able to publish a new api definition based on my open api specs.

Beside that, would it be possible to do tyk-sync update command to update existing api definition based on open specs api format ?

Thanks,

Rudy

Hi @rudytreasure ,

No, I don’t think that will work. Tyk would not be able to identify which API the swagger was updating because the swagger doesn’t contain the APIID.

Cheers,
Pete