fix: correct code examples against Nova/Kura source#5
Merged
Conversation
Cross-referenced all chapters against actual source code and fixed: - JSON API controllers use `json` key (not `params`) for decoded JSON bodies - login_post/1 passes Req1 to redirect so session cookie is sent, uses public nova_session:set/3 API - plugin_info/0 returns map (not tuple) per nova_plugin behaviour - sendfile tuple format matches actual Nova handler signature - nova_request_plugin options: replace non-existent read_body with parse_qs - utc_datetime maps to TIMESTAMPTZ (not TIMESTAMP) - Erlang version updated from 26 to 27 to match OTP requirement - Custom handler callback signature corrected - Security handler docs expanded with redirect and structured false returns Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 tasks
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.
Summary
jsonkey (notparams) for decoded JSON bodies —nova_request_pluginputs JSON intojson,paramsis for URL-encoded form dataReq1to redirect so session cookie is actually sent; use publicnova_session:set/3API instead of internalnova_session_ets:set_value/3plugin_info/0: return maps (not tuples) per thenova_pluginbehaviour — fixed in 3 plugin examples and the cheat sheetsendfiletuple: corrected to{sendfile, StatusCode, Headers, {Offset, Length, Path}, MimeType}nova_request_pluginoptions: replaced non-existentread_bodywithparse_qsutc_datetime: maps toTIMESTAMPTZ(notTIMESTAMP) — fixed in schemas-migrations and cheat sheetfun(ReturnTuple, CallbackFun, Req) -> {ok, Req2}{redirect, Path}and{false, StatusCode, Headers, Body}return optionsTest plan
🤖 Generated with Claude Code