apigee / apigeelint

Static code analysis for Apigee proxy bundles to encourage API developers to use best practices and avoid anti-patterns.
Apache License 2.0
92 stars 71 forks source link

ST003 | Apigeelint is appending `.content` to the source variable, even though the variable already includes the .content suffix #378

Closed prashantrahate closed 1 year ago

prashantrahate commented 1 year ago

Apigeelint is appending .content to the source variable, even though the variable already includes the .content suffix in its name (tokenResponse.content). Policy: image Apigeelint Result: image

As a result, proxy linter is producing an error message that appends .content twice.

When the source variable is changed to tokenResponse, the error message from Apigeelint is displayed correctly. image

Is it possible to fix this issue by adding the suffix ".content" only when it is not already provided in the source?

ssvaidyanathan commented 1 year ago

@prashantrahate - I think its working as expected. What the tool does - is its using the variable you use in the <Source> attribute and recommends to add that to the <Condition>

You do not need to add .content in the <Source> configuration. You just need to put tokenResponse. You can refer to this link.

Please update your ExtractVariables policy to just have the variable (excluding the .content) and then it should work as expected. The .content is required for the <Condition> tag, hence the tool suggest you add that to the variable.

prashantrahate commented 1 year ago

Got it, Thanks you @ssvaidyanathan.