Skip to content

Conversation

cpfiffer
Copy link
Contributor

@cpfiffer cpfiffer commented Sep 10, 2025

Summary

Snippets properly contain type/content fields:

image

Problem

The auto-generated API documentation examples were missing the required type: "text" discriminator field in message content objects. This caused validation errors when users tried the curl commands from the docs, as reported in Discord.

Solution

Added proper requestBody examples to the fern openapi-overrides.yml file for:

  • /v1/agents/{agent_id}/messages (POST)
  • /v1/agents/{agent_id}/messages/stream (POST)
  • /v1/groups/{group_id}/messages (POST)
  • /v1/groups/{group_id}/messages/stream (POST)

All examples now show:

  • content as an array of objects (not string)
  • Required type: "text" field for proper union type discrimination
  • Consistent example text across all endpoints

Add proper examples to streaming and non-streaming message endpoints that include the required 'type' field in content objects. Previously, the auto-generated examples were missing this discriminator field, causing validation errors when users tried the curl commands.

Updated endpoints:
- /v1/agents/{agent_id}/messages (POST)
- /v1/agents/{agent_id}/messages/stream (POST)
- /v1/groups/{group_id}/messages (POST)
- /v1/groups/{group_id}/messages/stream (POST)

All examples now show content as an array of objects with proper type discrimination rather than plain strings.
@cpfiffer cpfiffer merged commit 43e13a1 into main Sep 10, 2025
72 of 76 checks passed
@github-project-automation github-project-automation bot moved this from To triage to Done in 🐛 MemGPT issue tracker Sep 10, 2025
@cpfiffer cpfiffer deleted the fix-fern-api-examples branch September 10, 2025 21:54
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