Refresh REST API : do not import unreferenced structures
234
Views
3
Comments
New
Data & Integrations

tl;dr : When refreshing a REST API definition, import only structures actually used by the imported methods, instead of *all* the structures exposed by the API.

Details : 

When refreshing a consumed REST API definition, using the right-click "Refresh REST API..." context-menu item, you can select which methods will be imported. However, *ALL* the structures exposed by the API are imported, even if you import just a single method. 

This in turn triggers as many warnings as there are "Unused Structure", and we then have the tedious and error prone task of removing said unused structures.

If only the actually used structures of the selected methods were imported, the task would be much easier and less error prone.

Hi Francois, that's indeed very annoying. Did you find any workaround in the meantime?

Hi Carlos, no I haven't found a good workaround yet. 

The only workaround so far is to not import/refresh the API definition automatically and instead add new definitions manually. 

Of course, this is also error prone, but less tedious than removing 20 or 30+ unused structures. 

Agreed. Another possible workaround to split the methods into different services so each service has less methods and structs.