Skip to content

Declare the documented public API via Julia's public mechanism (#1215)#1312

Merged
quinnj merged 1 commit into
masterfrom
jq-public-api
Jun 16, 2026
Merged

Declare the documented public API via Julia's public mechanism (#1215)#1312
quinnj merged 1 commit into
masterfrom
jq-public-api

Conversation

@quinnj

@quinnj quinnj commented Jun 15, 2026

Copy link
Copy Markdown
Member

Supersedes #1215 (which targeted the deleted 1.x src/HTTP.jl and listed download/status — neither is an HTTP.jl function in 2.x).

HTTP.jl 2.x exports almost nothing (WebSockets, escape, and a few re-exports), so nearly the entire documented API is reached as HTTP.name without being formally marked public. Julia 1.11's public keyword exists exactly to distinguish supported public API from internals — this declares it, so downstream code and tooling (and names(HTTP)) reflect the real public surface. The retry_attempts/isrecoverable work from #1295/#1310 highlighted this gap.

What it does

  • The main module, HTTP.WebSockets, and HTTP.Handlers each declare their documented, non-exported names public. Already-exported names aren't repeated. get/get! are included (they're documented HTTP.get/HTTP.get! entry points, even though HTTP extends them from Base).
  • Gated on VERSION >= v"1.11.0-DEV.469" via Core.eval(@__MODULE__, Expr(:public, …)), which parses on Julia 1.10 (the package's lower compat bound, where the public keyword doesn't exist) — only the evaluation is version-gated.
  • No behavior change: public does not affect using HTTP; it's metadata.

Validation

  • names(HTTP) now surfaces 107 names (was just the exports); internals like _retryable_request_error/_normalize_local_addr correctly stay private.
  • New test/public_api_tests.jl parses docs/src/api/*.md and asserts every documented HTTP.* name is exported-or-public (and internals are private) — a doc-parity guard so future documented additions can't silently skip the declaration. It already caught one gap during development (HTTP.@client).

🤖 Generated with Claude Code

HTTP.jl 2.x exports almost nothing (`WebSockets`, `escape`, plus a handful of
re-exports), so nearly the entire documented API is reached as `HTTP.name`
without being formally marked public. Julia 1.11 added the `public` keyword to
distinguish supported public API from internals; declare it here so downstream
code and tooling can tell the difference (and `names(HTTP)` reflects the real
surface).

- Main module, HTTP.WebSockets, and HTTP.Handlers each declare their documented,
  non-exported names public. Already-exported names are public via `export` and
  are not repeated. Names HTTP only extends from Base (`get`, `get!`) are
  included since they are documented `HTTP.get`/`HTTP.get!` entry points.
- The declaration is gated on `VERSION >= v"1.11.0-DEV.469"` and uses
  `Core.eval(@__MODULE__, Expr(:public, …))`, which parses on Julia 1.10 (the
  package's lower compat bound) where the `public` keyword does not exist.
- New test asserts every name documented in docs/src/api/*.md is exported or
  public, and that internals stay private — so future docs additions can't
  silently skip the declaration.

Supersedes the stale 1.x-targeting PR #1215 (which listed `download`/`status`,
neither of which is an HTTP.jl function in 2.x). No behavior change: `public`
does not affect `using HTTP`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.16%. Comparing base (f8e9db6) to head (b6f7fae).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1312   +/-   ##
=======================================
  Coverage   87.15%   87.16%           
=======================================
  Files          29       29           
  Lines       11291    11291           
=======================================
+ Hits         9841     9842    +1     
+ Misses       1450     1449    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@quinnj quinnj merged commit bb14ad9 into master Jun 16, 2026
8 checks passed
@quinnj quinnj deleted the jq-public-api branch June 16, 2026 03:41
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