oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

feature: Add support for path aliases

Open rodcloutier opened this issue 2 years ago • 2 comments

This PR intends to add support for path aliases using references as such

  /test/alias/{name}:
    $ref: "#/paths//test/{name}"

  /test/{name}:
    get:
      tags:
        - test
      summary: Get test
      operationId: getTestByName

It assumes that the operationId can only be repeated if you have a reference.

Fixes #223

rodcloutier avatar Jun 03 '22 01:06 rodcloutier

I just noticed that since I replaced a slice with a map for lookup, the order of the functions in the generated code actually changes. This is undesirable and I will address that.

rodcloutier avatar Jun 03 '22 02:06 rodcloutier

Hi, @deepmap-marcinr is there something missing from this PR to help make it land? We are using @rodcloutier's fork with this feature for transitioning some paths to a v1 prefix and this patch helps remove duplication for two endpoints varying only by path. I am available for helping if need be.

davidovich avatar Dec 15 '22 13:12 davidovich