Skip to content

Conversation

nikkothari22
Copy link
Member

@nikkothari22 nikkothari22 commented Sep 18, 2024

Earlier, the logic to find the function definition string was to go from the first mention of "def" to the first mention of ":" after the def index.

With type annotations, this means that a function like this

def add(a: int, b:int):

  #Add logic here

would give a function def like: add(a which is incorrect.

Two changes made:

  1. For the ending index, look for ): instead of just the colon since that will signal the end of the function definition.
  2. API Def is extracted until the last index of "):" + 1 to cover the last character.

This ensures that all params are covered.

@nikkothari22 nikkothari22 changed the title fix: API params are correctly loaded fix: API params are correctly extracted Sep 18, 2024
@sumitjain236 sumitjain236 merged commit e9648b7 into main Sep 19, 2024
@sumitjain236 sumitjain236 deleted the fix-api-params branch September 19, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants