Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

Add information about direct Openapi ingestion#62

Merged
h3xxit merged 8 commits intodevuniversal-tool-calling-protocol/python-utcp:devfrom
openapiuniversal-tool-calling-protocol/python-utcp:openapiCopy head branch name to clipboard
Sep 8, 2025
Merged

Add information about direct Openapi ingestion#62
h3xxit merged 8 commits intodevuniversal-tool-calling-protocol/python-utcp:devfrom
openapiuniversal-tool-calling-protocol/python-utcp:openapiCopy head branch name to clipboard

Conversation

@perrozzi
Copy link
Contributor

@perrozzi perrozzi commented Sep 7, 2025

Summary by cubic

Add OpenAPI ingestion docs and a README quick start to convert OpenAPI 2.0/3.0 specs into UTCP tools with no extra infrastructure. This enables direct HTTP tool generation from existing REST APIs with clear, working examples.

  • New Features
    • Added docs/openapi-ingestion.md covering five methods: direct converter, remote URL, UTCP client config, batch processing, and local files.
    • Updated README with a quick start and link to the full guide.
    • Documented auth mapping (API key, Basic, Bearer, OAuth2), JSON/YAML support, and schema/$ref resolution.

h3xxit and others added 7 commits August 26, 2025 17:03
Fix response json parsing when content type is wrong
- Add detailed OpenAPI ingestion guide with 5 different methods
- Include working code examples for all ingestion approaches
- Add prominent OpenAPI section to main README
- All code snippets tested and validated
- Zero infrastructure approach highlighted
- Remove unnecessary duplication and complexity
- Focus on core functionality with minimal examples
- Reduce from verbose guide to concise reference
- All code snippets tested and working
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 2 files

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

# Or use UTCP Client configuration for automatic detection
from utcp.utcp_client import UtcpClient

client = await UtcpClient.create(config={
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using await at top level in this snippet will not run in a standard Python script; wrap in an async function or use asyncio.run.

Prompt for AI agents
Address the following comment on README.md at line 568:

<comment>Using await at top level in this snippet will not run in a standard Python script; wrap in an async function or use asyncio.run.</comment>

<file context>
@@ -538,4 +538,61 @@ The build process now involves building each package (`core` and `plugins`) sepa
+# Or use UTCP Client configuration for automatic detection
+from utcp.utcp_client import UtcpClient
+
+client = await UtcpClient.create(config={
+    &quot;manual_call_templates&quot;: [{
+        &quot;name&quot;: &quot;github&quot;,
</file context>
Fix with Cubic


async def load_remote_spec(url):
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing response.raise_for_status() before reading the response may hide HTTP errors; add it in the batch processing example.

Prompt for AI agents
Address the following comment on docs/openapi-ingestion.md at line 44:

<comment>Missing response.raise_for_status() before reading the response may hide HTTP errors; add it in the batch processing example.</comment>

<file context>
@@ -0,0 +1,149 @@
+
+async def load_remote_spec(url):
+    async with aiohttp.ClientSession() as session:
+        async with session.get(url) as response:
+            response.raise_for_status()
+            openapi_spec = await response.json()
</file context>
Fix with Cubic

from utcp_http.openapi_converter import OpenApiConverter

async def load_remote_spec(url):
async with aiohttp.ClientSession() as session:
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a new aiohttp.ClientSession inside the loop adds unnecessary overhead and prevents connection reuse; create one session and reuse it for all URLs.

Prompt for AI agents
Address the following comment on docs/openapi-ingestion.md at line 43:

<comment>Creating a new aiohttp.ClientSession inside the loop adds unnecessary overhead and prevents connection reuse; create one session and reuse it for all URLs.</comment>

<file context>
@@ -0,0 +1,149 @@
+from utcp_http.openapi_converter import OpenApiConverter
+
+async def load_remote_spec(url):
+    async with aiohttp.ClientSession() as session:
+        async with session.get(url) as response:
+            response.raise_for_status()
</file context>
Fix with Cubic

async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
response.raise_for_status()
openapi_spec = await response.json()
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using response.json() will fail for YAML specs in spec_urls; parse text with yaml.safe_load to support both YAML and JSON.

Prompt for AI agents
Address the following comment on docs/openapi-ingestion.md at line 46:

<comment>Using response.json() will fail for YAML specs in spec_urls; parse text with yaml.safe_load to support both YAML and JSON.</comment>

<file context>
@@ -0,0 +1,149 @@
+    async with aiohttp.ClientSession() as session:
+        async with session.get(url) as response:
+            response.raise_for_status()
+            openapi_spec = await response.json()
+    
+    converter = OpenApiConverter(openapi_spec, spec_url=url)
</file context>
Fix with Cubic

- Add plugin comments to all UTCP imports
- Show which imports come from core vs utcp-http plugin
- Clarify YAML loader also handles JSON files
@h3xxit h3xxit closed this Sep 8, 2025
@h3xxit h3xxit reopened this Sep 8, 2025
@h3xxit h3xxit merged commit 76b07db into dev Sep 8, 2025
18 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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.