-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add ApiSpecFetcher for Fetching and Comparing API Specifications #900
Add ApiSpecFetcher for Fetching and Comparing API Specifications #900
Conversation
Signed-off-by: Junwei Dai <[email protected]>
Signed-off-by: Junwei Dai <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #900 +/- ##
============================================
+ Coverage 78.04% 78.10% +0.06%
- Complexity 977 990 +13
============================================
Files 97 99 +2
Lines 4554 4599 +45
Branches 423 428 +5
============================================
+ Hits 3554 3592 +38
- Misses 823 827 +4
- Partials 177 180 +3 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Junwei Dai <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! A few suggestions you can take or leave; only thing I'd insist on changing before approval is the too-broad throwing of Exception
.
src/main/java/org/opensearch/flowframework/exception/ApiSpecParseException.java
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ApiSpecFetcher.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ApiSpecFetcher.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ApiSpecFetcher.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/flowframework/util/ApiSpecFetcherTests.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ApiSpecFetcher.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start!
src/main/java/org/opensearch/flowframework/exception/ApiSpecParseException.java
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ApiSpecFetcher.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/flowframework/workflow/RegisterAgentTests.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/flowframework/workflow/RegisterAgentTests.java
Show resolved
Hide resolved
Signed-off-by: Junwei Dai <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more tweaks.
src/main/java/org/opensearch/flowframework/common/CommonValue.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ApiSpecFetcher.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ApiSpecFetcher.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/flowframework/exception/ApiSpecParseExceptionTests.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Junwei Dai <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving with a few last items to clean up
src/test/java/org/opensearch/flowframework/util/ApiSpecFetcherTests.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/flowframework/util/ApiSpecFetcherTests.java
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ApiSpecFetcher.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Junwei Dai <[email protected]>
* Added ApiSpecFetcher with test Signed-off-by: Junwei Dai <[email protected]> * remove duplication license Signed-off-by: Junwei Dai <[email protected]> * Add more test to pass test coverage check Signed-off-by: Junwei Dai <[email protected]> * new commit address all comments Signed-off-by: Junwei Dai <[email protected]> * new commit address all comments Signed-off-by: Junwei Dai <[email protected]> * Addressed all comments Signed-off-by: Junwei Dai <[email protected]> --------- Signed-off-by: Junwei Dai <[email protected]> Co-authored-by: Junwei Dai <[email protected]> (cherry picked from commit 57b8b59) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ifications (#906) * Add ApiSpecFetcher for Fetching and Comparing API Specifications (#900) * Added ApiSpecFetcher with test Signed-off-by: Junwei Dai <[email protected]> * remove duplication license Signed-off-by: Junwei Dai <[email protected]> * Add more test to pass test coverage check Signed-off-by: Junwei Dai <[email protected]> * new commit address all comments Signed-off-by: Junwei Dai <[email protected]> * new commit address all comments Signed-off-by: Junwei Dai <[email protected]> * Addressed all comments Signed-off-by: Junwei Dai <[email protected]> --------- Signed-off-by: Junwei Dai <[email protected]> Co-authored-by: Junwei Dai <[email protected]> (cherry picked from commit 57b8b59) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Add slf4j-api and jackson-core dependencies Signed-off-by: Daniel Widdis <[email protected]> --------- Signed-off-by: Junwei Dai <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Daniel Widdis <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Junwei Dai <[email protected]> Co-authored-by: Daniel Widdis <[email protected]>
Description
Introduced a new
ApiSpecFetcher
utility to programmatically fetch and compare OpenAPI specifications.Supports comparing required input fields between an OpenAPI spec and predefined enum values.
The current implementation serves as a foundational mechanism, with the comparison logic successfully integrated into the
Register Agent
workflow.Future PRs will extend this mechanism to other workflow steps, ensuring consistent validation across the API specification.
Related Issues
Part of #651
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.