JSON and YAML schemas for various JSON file types used by Tyk products. You can use these schemas in your IDE or favourite editor to get auto-completion and validation of all your Tyk-related configuration files.
This project is an MVP and still WIP
Symbol | Description |
---|---|
✅ | Fully supported |
Untested / Requires Documentation | |
❌️ | Not currently supported |
NA | Not available |
Type | JSON | YAML | Comments |
---|---|---|---|
Tyk API definition | ❌️ | - | |
Tyk API OAS definition | ❌️ | ❌️ | - |
Tyk key definition | ❌️ | Also referred as "session object" | |
Tyk policy definition | ❌️ | ❌️ | - |
Tyk OSS gateway config file | NA | - | |
Tyk Pro gateway config file | ❌️ | NA | - |
Tyk hybrid gateway config file | ❌️ | NA | - |
Tyk pump config file | ❌️ | NA | - |
Tyk dashboard config file | ❌️ | NA | - |
Tyk Identity broker config file | ❌️ | NA | - |
To write in "Tyk language" and feel it's native to your IDE config the settings in your IDE to use the JSON schemas in this repository
-
Open your VSCode
settings.json
as explained here. -
Add the following lines to your
setting.json
:
"json.schemas": [
{
"fileMatch": [
"tyk.*.conf"
],
"url": "https://raw.githubusercontent.com/letzya/tyk-schemas/main/schema_tyk.oss.conf"
},
{
"fileMatch": [
"apikey.*.json"
],
"url": "https://raw.githubusercontent.com/letzya/tyk-schemas/main/schema_apikey.json"
},
{
"fileMatch": [
"apidef.*.json"
],
"url": "https://raw.githubusercontent.com/letzya/tyk-schemas/main/schema_apidef_lean.json"
},
],
- If you want IntelliSense to work for Tyk's config files you need VSCode to recognise
.conf
extension as JSON. To achieve that add the following:
"files.associations": {
"*.conf": "json"
}
-
cmd+shift+p
to Reload the window -
Create files with the name convention you used in step #2
- Tyk API definition - use the format
"apidef.*.json"
, for example"apidef.httpbin.json"
- Tyk key definition - use the format
"apikey.*.json"
, for example"apikey.httpbin-key.json"
- Tyk gateway OSS config file - use the format
"tyk.*.conf"
, for example"tyk.gateway.conf"
- Tyk API definition - use the format
Open the project's preferences (cmd+,
) and under JSON Schema mapping set the access of Goland to the JSON schemas and the file formats per the example in this screenshot: