Skip to content

Support basepath, REST routes and errors without HTTP status - #20

Merged
david-littlefarmer merged 1 commit into
masterfrom
basepath-and-rest-routes
Sep 29, 2026
Merged

david-littlefarmer merged 1 commit into
masterfrom
basepath-and-rest-routes

Conversation

@VojtechVitek

Copy link
Copy Markdown
Contributor

ridlfmt fails with unknown section on valid RIDL, including webrpc's own _examples/golang-basics/example.ridl:

  • basepath = /v1 — existing schema directive
  • path = /users and GET /{userId} — REST routes coming in webrpc
  • error 200 UserNotFound "user not found" — no HTTP <status>, webrpc defaults it to 400

Changes:

  • basepath formats like name/version
  • service path = at 2 spaces, route lines at 6 spaces under their method
  • errors without an HTTP status stay without one — we don't invent a 400

Tested: the webrpc repo's test.ridl and example.ridl now format, and a second run is a no-op.

🤖 This message was generated by Claude on behalf of Vojtech.

ridlfmt failed with "unknown section" on valid RIDL:

- `basepath = /v1`, an existing webrpc schema directive
- `path = /users` and `GET /{userId}` route lines, from the new webrpc
  REST routes support
- `error 200 UserNotFound "user not found"` without `HTTP <status>`,
  which webrpc defaults to 400

Format basepath like name/version, the service path at 2 spaces and
route lines at 6 spaces under their method. Errors without an HTTP
status keep omitting it instead of inventing one.
@david-littlefarmer
david-littlefarmer merged commit 7bcec5b into master Sep 29, 2026
1 check passed
@david-littlefarmer
david-littlefarmer deleted the basepath-and-rest-routes branch September 29, 2026 07:14
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