Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add support for parameterless ops #11

Merged
merged 1 commit into from
Jan 10, 2025
Merged

fix: Add support for parameterless ops #11

merged 1 commit into from
Jan 10, 2025

Conversation

vblagoje
Copy link
Owner

@vblagoje vblagoje commented Jan 10, 2025

Why:

Enhances the _convert_operation_to_openai_schema function to correctly handle OpenAPI specifications that lack parameters, ensuring valid schema returns even when no parameters are present.

What:

  • Modified _convert_operation_to_openai_schema to handle parameterless specifications by implementing a fall-back schema creation mechanism.
  • Added a new YAML file parameterless.yml to test parameterless OpenAPI schema scenarios.
  • Updated existing tests and added new test cases to validate the handling of parameterless API specifications.

How can it be used:

  • Internal change not visible to users

This ensures the function outputs a valid schema when processing specs without parameters.

How did you test it:

Test cases were added to verify proper conversion of parameterless OpenAPI specifications. The new tests validate that functions are correctly extracted and described, even in the absence of parameters.

Notes for the reviewer:

Ensure to check that the revamped _convert_operation_to_openai_schema consistently handles edge cases related to missing parameters, and that other functionalities remain intact. Pay attention to the additional test coverage introduced via parameterless.yml.

@vblagoje vblagoje changed the title feat: Add support for parameterless ops fix: Add support for parameterless ops Jan 10, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12712467778

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 81.293%

Files with Coverage Reduction New Missed Lines %
core/schema_conversion.py 5 91.15%
Totals Coverage Status
Change from base Build 12701310633: 0.0%
Covered Lines: 352
Relevant Lines: 433

💛 - Coveralls

@vblagoje vblagoje merged commit 8fc3c1f into main Jan 10, 2025
9 checks passed
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.

Empty parameter operations not supported in OpenAPI to schema conversion
2 participants