Michael the answer is: look at prior art as documentation can quickly get out of date and tends to only skim the surface. In contrast, popular plugins are often kept very up to date and cover more complex use cases.
Using existing repos to understand approaches is absolutely what I and my colleagues have learnt to do over the last few years.
I can recommend looking at those of core Discourse team (official), those of Pavilion (pavilion) and my repos for examples of how to do stuff (in that order! ).
As the platform evolves with newer versions of dependencies and new capabilities, official plugins leveraging the new technologies added to the platform, for example, can be really useful as starting points.
Look for a plugin that functionally does something similar to what you achieve and copy the approach.
Here’s an example of a plugin adding one route: