Demo OTP app refactor, docs fixes, and release 0.1.1 - #12
Merged
Merged
Conversation
Replace demo.escript with demo_app and demo_sup modules. Routes are defined in demo_sup:routes/0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Handler arity is 4 (PathArgs, QueryArgs, Headers, Body), not 3
- Document {MetaData, Routes} variant for callback_args
- Document QueryArgs as second handler argument
- Document binary() as the body type for bodyless methods (GET etc.)
- Document -spectra()/-spec placement constraint
- Fix Swagger UI URL in CHANGELOG (was /api-docs, is /swagger)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the example/ demo from an escript into a proper OTP application and adds root-level tooling/config so the demo can be built and run from the repo root.
Changes:
- Introduces
demo_app(application callback) anddemo_sup(supervisor) for the example app and wires them viademo.app.src. - Adds a root
demorebar3 profile andmake demotarget to run the example from the repo root. - Updates version/docs/changelog to reflect the new handler arity and demo run instructions.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/elli_openapi.app.src | Bumps library version to 0.1.1. |
| rebar.config | Adds demo profile to build/run the example/ app from the repo root. |
| example/src/demo_sup.erl | Replaces demo.escript logic with a supervisor that starts Elli and defines routes. |
| example/src/demo_app.erl | Adds OTP application callback to start the supervisor and print the Swagger URL. |
| example/src/demo.app.src | Wires the demo app to demo_app via {mod, {demo_app, []}}. |
| example/rebar.config | Updates shell config (removes script_file). |
| README.md | Updates dependency version, handler signature docs, and demo run instructions (make demo). |
| Makefile | Adds demo target calling rebar3 as demo shell. |
| CHANGELOG.md | Adds 0.1.1 entry and updates documented endpoints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
user_handler was exporting /3 functions while the library requires /4 (PathArgs, QueryArgs, Headers, Body). Add user_handler_SUITE to catch this class of regression going forward. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
demo.escriptwith a proper OTP app (demo_app,demo_sup) in theexample/directorydemoprofile to rootrebar.configandmake demotarget for running the example from the repo rootTest plan
make build-testpassesmake demostarts the shell and prints the Swagger URL🤖 Generated with Claude Code