AnswerDotAI / AnswerDotAI/fastspec

Truncate long string leaves when rendering body examples

Open Beginner friendly
#33 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
5
Forks
4
Avg merge
2d 47m
Merged PRs (30d)
4

Description

Some media-type examples embed large blobs — e.g. GitHub's `repos.create_attestation` example is ~10KB of base64 (`canonicalizedBody`, `rawBytes`, `payload`), bloating `__doc__` for LLM consumption.

Follow-up: in `_examples_doc` (from #30), recursively cap string leaves at render time (e.g. >~100 chars → `prefix…+N chars`), keeping `OpSpec.body_examples` lossless. No content sniffing needed: capping leaf length handles base64 automatically while normal prose/URLs pass through. Optionally also cap examples shown per op.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at `_examples_doc` from #30 and trace how it renders `OpSpec.body_examples`. Recursively cap string leaves at roughly 100 characters while keeping `OpSpec.body_examples` lossless; verify that long embedded blobs are shortened and ordinary prose or URLs remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.