Skip to content

Demo OTP app refactor, docs fixes, and release 0.1.1 - #12

Merged
andreashasse merged 6 commits into
mainfrom
demo-otp-refactor
Mar 27, 2026
Merged

andreashasse merged 6 commits into
mainfrom
demo-otp-refactor

Conversation

@andreashasse

@andreashasse andreashasse commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace demo.escript with a proper OTP app (demo_app, demo_sup) in the example/ directory
  • Add demo profile to root rebar.config and make demo target for running the example from the repo root
  • Fix documentation: handler spec placement rules, argument descriptions, and review feedback
  • Add link to Spectra documentation in README
  • Prepare release 0.1.1 (CHANGELOG, README, app.src version bumped)

Test plan

  • make build-test passes
  • make demo starts the shell and prints the Swagger URL

🤖 Generated with Claude Code

andreashasse and others added 4 commits March 27, 2026 09:13
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>
@andreashasse
andreashasse requested a review from Copilot March 27, 2026 08:32
@andreashasse andreashasse changed the title Refactor demo to proper OTP app structure Demo OTP app refactor, docs fixes, and release 0.1.1 Mar 27, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and demo_sup (supervisor) for the example app and wires them via demo.app.src.
  • Adds a root demo rebar3 profile and make demo target 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.

Comment thread README.md
Comment thread example/rebar.config
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>
@andreashasse
andreashasse merged commit 764a9b5 into main Mar 27, 2026
2 checks passed
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.

2 participants