Repository navigation
Document type: Presenter with explicit input validation - #48
Merged
dblock merged 1 commit intoOct 27, 2026
Merged
Conversation
Danger ReportNo issues found. |
dblock
force-pushed
the
docs/presenter-parameter-types-9
branch
2 times, most recently
from
October 27, 2026 10:43
9309761 to
9a597f6
Compare
This was referenced Oct 27, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dblock
force-pushed
the
docs/presenter-parameter-types-9
branch
from
October 27, 2026 11:30
9a597f6 to
fe431d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9.
Provide a tested application-local input decorator implementing Grape’s existing
.parsecontract, allowing exactlytype: Presenter. Explicitly validate incoming shapes and required nonblank values, allowlist writable fields through Roar, and return the decorator rather thanfrom_hash’s model result so Grape’s type check succeeds.Execute the exact README example in actual JSON requests. Cover valid coercion, undeclared properties, malformed/incomplete input, blank titles, and missing parameters; invalid input returns 400 before model construction. No automatic schema inference, generic model constructor, or runtime API changes.
Keep test bundles on JSON 2.x for Ruby older than 3.2, whose compatible MultiJson versions use JSON.load options removed in JSON 3. Verify the complete suite and lint on Ruby 2.7/Grape 1.8 as well as Ruby 4/Grape 4; modern bundles continue exercising JSON 3. This same prerequisite is included in #49 so each PR works independently.
AI-authored on behalf of @dblock.