-
I recently had an unexpected match in for an openAPIOperation directive in my portman-config, which includes the following: overwrites:
- openApiOperation: "*::/*/{id}"
overwriteRequestPathVariables:
- key: id
value: '{{<tag>Id}}'
overwrite: true In my API spec I have defined a compound API path that does not include an id path parameter as follows: /plaid_accounts/fetch:
post:
tags:
- plaid_accounts
summary: Trigger Fetch from Plaid
operationId: triggerPlaidAccountFetch
parameters:
- name: start_date
in: query
schema:
type: string
format: date
- name: end_date
in: query
schema:
type: string
format: date
- name: plaid_account_id
in: query
schema:
type: integer When I run portman with this config, it is generate a request with an id path parameter: I was able to correct this by updating my config as follows: overwrites:
- openApiOperation: "*::/*/{id}"
excludeForOperations:
- "POST::/plaid_accounts/fetch"
overwriteRequestPathVariables:
- key: id
value: '{{<tag>Id}}'
overwrite: true But I hadn't expected the OpenApiOperation value ":://{id}" to match a path without the "{id}" at the end. This is likely a case of me not understanding the pattern-matching rules, but in case this seems odd to the portman team, I've also attached a simplified spec and config |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
hi @jpjpjp I created a PR that improved the target matching, which results in: |
Beta Was this translation helpful? Give feedback.
FYI @jpjpjp This is now part of version 1.30.5 of Portman, so be sure to update.