Skip to content

Conversation

@densetsuuu
Copy link
Contributor

@densetsuuu densetsuuu commented Feb 1, 2026

Add domain property to route definitions

Closes #85

Summary

This change adds the domain property to the generated route registry and the AdonisEndpoint type, allowing Tuyau to be aware of which domain each route belongs to (e.g. 'root', 'api', etc.).

Testing

  • Added a new api.v1.teste test fixture with domain: 'api' to cover non-root domain routes
  • Added a Client | Registry domain test group with two cases:
    • Verifies that domain-scoped routes expose their correct domain (e.g. 'api')
    • Verifies that routes without an explicit domain default to 'root'

Aim

Previously, all routes were treated as belonging to the 'root' domain regardless of their actual AdonisJS domain configuration. This made it impossible to distinguish routes defined under different domains (e.g. router.group(() => { ... }).domain('api')). With this change, the domain information flows through from AdonisJS route scanning to the generated registry and into the client, enabling domain-aware route resolution.

@densetsuuu
Copy link
Contributor Author

densetsuuu commented Feb 1, 2026

Sorry @Julien-R44, the PR is a little bit bloated because I had to update the fixtures and scripts too ahah

@densetsuuu densetsuuu marked this pull request as draft February 1, 2026 13:11
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.

[Bug] Routes with .domain() are flattened into root and lose domain metadata in registry

1 participant