Skip to content

Path grouping via a RegEx pattern #215

@cascer1

Description

@cascer1

Hi!

I'm testing this tool using a large API spec (the Globalcollect S2S API, to be specific), and having just one list of endpoints isn't very useful.

Instead, it would be awesome if I could define (for example) a RegEx pattern for headers, which is then used for grouping paths.

For example: The Globalcollect API has endpoints in categories like payments, payouts and products:

  • POST {merchantId}/payments
  • GET {merchantId}/payments/{id}
  • POST {merchantId}/payments/{id}/approve
  • POST {merchantId}/payments/{id}/cancel
  • POST {merchantId}/payouts
  • GET {merchantId}/payouts/{id}
  • GET {merchantId}/products
  • POST {merchantId}/products
  • GET {merchantId}/products/{id}
  • etc. (You get the idea).

In another tool I'm developing, I added the ability to match endpoints to a RegEx, and assign them to a category if they match, the categories are generated based on the first capture groups in the patterns. Using the example above, I then match them with RegEx \/{merchantId}\/(\w+)$

This results in the categories payments, payouts and products being created. All paths are then put inside these categories. This results in the following structure (All paths have a description so they can get a pretty name):

image

A similar functionality in this tool would be awesome!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions