modifying-http-endpoints

Add and modify REST API endpoints in Golem services using Poem.

1.5k|207|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill modifying-http-endpoints
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modifying-http-endpoints
Source: https://github.com/golemcloud/golem/tree/main/.agents/skills/modifying-http-endpoints
Command: npx skills add https://github.com/golemcloud/golem --skill modifying-http-endpoints

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a structured approach to adding or modifying HTTP REST API endpoints within Golem services, ensuring consistency and maintainability of the Golem API.

Core Features & Use Cases

  • Endpoint Definition: Guides on defining new endpoints using Poem and poem-openapi annotations.
  • Service Integration: Explains where to locate and how to integrate new API definitions within worker and registry services.
  • Type Management: Details on defining and mapping request/response types for OpenAPI compatibility.
  • Regeneration & Verification: Outlines the essential steps for regenerating OpenAPI specifications and rebuilding client crates.
  • Use Case: When a new feature requires a new API endpoint in the Golem worker service, this Skill will guide the developer through defining the endpoint, its request/response types, and the necessary regeneration steps.

Quick Start

Use the modifying-http-endpoints skill to add a new POST endpoint to the worker service at the path /v1/my-new-action.

Frequently Asked Questions about modifying-http-endpoints

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new HTTP endpoint to a Golem service using Poem?

To add a new HTTP endpoint in Golem, define the method using Poem and poem-openapi annotations, integrate the API struct into the worker or registry service, and update request/response types in golem-common for OpenAPI compatibility.

How do I regenerate OpenAPI specifications after modifying Golem REST API endpoints?

After modifying Golem REST API endpoints, regenerate the OpenAPI specifications and rebuild the client crates to ensure the generated API documentation and client code reflect the new endpoint definitions, request schemas, and response types.

Where do I define request and response types for a new Golem API endpoint?

Request and response types for a new Golem API endpoint are defined and mapped in the golem-common crate to ensure OpenAPI compatibility and consistent schema management across worker and registry services.

When do I need to use poem-openapi to modify Golem REST API routes?

Use poem-openapi when adding or modifying HTTP REST API endpoints in Golem services to define new endpoint methods and ensure the API routes are properly annotated for OpenAPI specification generation and schema validation.

Does Golem API modification require updating both worker and registry services?

Golem API modification may require updating either the worker service or registry service depending on where the new endpoint is integrated, along with shared type definitions in golem-common and subsequent OpenAPI specification regeneration.