Discovering partion keys in the storage table
One more thing if you note here is that when we use the AzureStorageTableConnector, it asks us for the partion key that can have only two values in our scenario, either author or chapter. It would be nice if our custom connector can go to storage table and find all the partion keys available and then may be provide it as a drop-down so that we can select the partion key instead of entering the value. This can be done using dynamic Swagger to enhance user experience. Swagger dynamically generates metadata depending on API App configuration.
To do this, you need to add a filter, as follows:
In the filter implementation, it looks for the parameter authorOrChapter
, and if it finds the parameter, it will add it as an enumeration, which means the authorOrChapter
parameter can take all the partition keys (author and chapter) as the enumeration value. To add the partition keys to enum
, we have the method GetPartionKeys
that abstracts how you get all...