Skip to content

Add JsonRequestBody shorthand annotation and attribute - #53

Merged
DerManoMann merged 3 commits into
mainfrom
feature/json-request-body
Jun 12, 2026
Merged

Add JsonRequestBody shorthand annotation and attribute#53
DerManoMann merged 3 commits into
mainfrom
feature/json-request-body

Conversation

@DerManoMann

Copy link
Copy Markdown
Owner

Summary

  • Adds JsonRequestBody attribute and annotation that mirrors the existing JsonResponse shorthand — wraps ref/type in JsonContent automatically
  • Auto-derives description from the referenced schema (title > description > schema name > class short name) via AugmentJsonRequestBody processor
  • Defaults required to true (the common case for request bodies)
  • Renames JsonResponseTrait to JsonContentTrait to reflect shared usage

Test plan

  • Unit tests for attribute with ref, explicit description, no ref, and required flag
  • Unit tests for annotation with ref
  • Unit tests for processor description resolution (title, description, fallback, skip explicit)
  • Full test suite passes (67 tests)

🤖 Generated with Claude Code

DerManoMann and others added 3 commits June 12, 2026 15:19
Mirrors the existing `JsonResponse` pattern — wraps ref/type in
JsonContent automatically and auto-derives description from the
referenced schema. Renames `JsonResponseTrait` to `JsonContentTrait`
to reflect its shared usage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Request bodies are almost always required — this matches the convention
used in the custom implementation this feature was inspired by.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DerManoMann
DerManoMann merged commit f17ac4f into main Jun 12, 2026
7 checks passed
@DerManoMann
DerManoMann deleted the feature/json-request-body branch June 12, 2026 03:29
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.

1 participant