luckymarmot / API-Flow

Universal data structure and converter for API formats (Swagger, RAML, Paw, Postman…)
MIT License
193 stars 24 forks source link

Add filterWithReference method to ParameterContainer #121

Open JonathanMontane opened 7 years ago

JonathanMontane commented 7 years ago

Currently, if there are references in a ParameterContainer, one must first resolve all the References, then filter out the Parameters, and then if one wants to keep the concept of shared parameters in the context, one has to iterate over the resolved and filtered ParameterContainer to get the Ids of the corresponding Parameters in the original ParameterContainer and filter it with this set of keys, which is painful.

Adding the following method:

container.filterWithReference(store, constraints)

would simplify this process greatly.

Note: There are currently no formats that we support where this is needed, but with the addition of swagger v3, it could potentially appear.