Script to leave only selected collections for swagger documentation generated by directus.
If you want to use this script, type all desired collection names in the lists below.
custom_collections = ["ItemsExample"]
directus_collections = ["Example"]
- for custom collections, use the
custom_collections
- remember theItems
prefix for each collection(e.g. for theCars
collection it will beItemsCars
) - for default directus collections use the
directus_collections
Then just put file swagger.json
into the project directory and run script main.py
with python.
It will return a second swagger file named modified-swagger.json
with the desired result.