Skip to content

add openapi generation#3

Open
mikedotexe wants to merge 2 commits intomainfrom
codex/openapi-aggregate-explorer
Open

add openapi generation#3
mikedotexe wants to merge 2 commits intomainfrom
codex/openapi-aggregate-explorer

Conversation

@mikedotexe
Copy link
Copy Markdown

@mikedotexe mikedotexe commented Apr 13, 2026

Summary

This moves explorer-api to owning its aggregate OpenAPI document in-repo.

The checked-in openapi/openapi.yaml file is now generated from Rust request/response models plus a Rust-owned operation registry, instead of being maintained outside the service repo.

What changed

  • add an openapi feature with a generate-openapi binary
  • add src/openapi.rs to build the aggregate OpenAPI document
  • check in openapi/openapi.yaml
  • move shared app types, routes, and docs handlers into lib.rs so both the server binary and the OpenAPI generator can reuse them
  • update README docs to describe the current docs pipeline

This covers the /v0 transactions, account, block, blocks, and receipt endpoints.

Why the main.rs -> lib.rs split

This is not intended as an architectural rewrite.

Rust binaries cannot be imported by other binaries, so the new generate-openapi binary needed a small shared library surface for:

  • app state types
  • route scopes and docs handlers
  • request and response DTOs

The server startup flow remains in main.rs; the shared reusable pieces moved to lib.rs.

What did not change

  • the public HTTP routes and handlers remain the same
  • the larger diff is mostly the checked-in aggregate OpenAPI output and typed schema exposure, not new runtime behavior
  • server startup, env loading, logging, and binding remain in main.rs
  • portal-owned per-operation splitting and docs enhancements still live outside this repo

Validation

cargo check
cargo run --features openapi --bin generate-openapi -- --check

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