Truncate long string leaves when rendering body examples

Open Beginner friendly
#33 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

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.

Dominant language
Jupyter Notebook
Stars
5
Forks
4
Avg merge
2d 47m
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AnswerDotAI/fastspec

All issues in AnswerDotAI/fastspec

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.