Skip to content

Format REST routes as + VERB /path - #21

Merged
VojtechVitek merged 1 commit into
masterfrom
rest-routes-plus-annotation
Oct 18, 2026
Merged

VojtechVitek merged 1 commit into
masterfrom
rest-routes-plus-annotation

Conversation

@VojtechVitek

Copy link
Copy Markdown
Contributor

Follow-up to #20. webrpc#517 changed the REST route syntax, so the formatter has to follow.

basepath = /v1

service Intents
  - CommitIntent(CommitIntentRequest) => (CommitIntentResponse)
      + POST /intents/{intentId}
      + POST /Intents/CommitIntent # backward-compatible with pre-REST API route.
  • A route is a + VERB /path line under a method, zero or more per method. Paths are absolute.
  • It counts as a route only inside a service, with a known verb and a path starting with /. Other + lines keep the + key = value behavior.
  • Service-level path = and bare GET /x lines are gone. The formatter now rejects them, like the webrpc parser.
  • Routes keep their written order. Formatting twice gives the same output.

Tests cover single and multiple routes, odd spacing, routes next to meta lines and after errors, and the old syntax being rejected. Formatter coverage is 99.7%.

Merge after webrpc#517 lands.

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

webrpc#517 replaced the service-level `path =` and the bare route line
with `+ VERB /path` meta lines, zero or more per method, absolute paths.

A `+` line is a route only inside a service, with a known verb and a
path starting with `/`. Other `+` lines keep the `+ key = value` path.
The old `path =` and bare route lines are no longer recognised.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@VojtechVitek
VojtechVitek merged commit 10b896e into master Oct 18, 2026
1 check passed
@VojtechVitek
VojtechVitek deleted the rest-routes-plus-annotation branch October 18, 2026 14:46
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