openapi

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultEndpointToolName

func DefaultEndpointToolName(entityName, method, path string) string

DefaultEndpointToolName synthesises an MCP tool name from an entity + method + path triple. Used as a fallback when an Endpoint doesn't supply an explicit MCPName.

func EntityEndpointPath

func EntityEndpointPath(ent *entity.Entity, path string) string

EntityEndpointPath builds the absolute URL path for a custom Endpoint declared on an entity. Relative paths are joined under the entity's table; absolute paths pass through. ":id"-style params are converted to "{id}".

func EntityOpenAPI

func EntityOpenAPI(registry entity.Registry, title, version string, basePath ...string) *openapi.Spec

EntityOpenAPI generates a full OpenAPI Spec from all registered entities. It produces:

  • Schema components for each entity with typed fields
  • CRUD paths (GET, POST, PUT, DELETE) with request/response schemas
  • List endpoint with pagination parameters
  • Proper error response schemas

EntityOpenAPI builds the spec for every registered entity. An optional basePath (e.g. "/api", from AppConfig.APIPrefix) is expressed as the server URL so the documented paths match where the routes actually mount — the per-path keys stay relative (e.g. "/posts"), and clients prepend the server.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL