Plugin-API Param question

Does the plugin-API nolonger support transcript/:id style routes?
import { ApplyOptions } from '@sapphire/decorators';
import { Route, type RouteOptions } from '@sapphire/plugin-api';

@ApplyOptions<RouteOptions>({ route: 'transcript/:id', methods: ['GET'] })
export class TranscriptRoute extends Route {
public async run(_request: Route.Request, response: Route.Response): Promise<void> {
const { id } = _request.params as { id: string };

// Code...
}
}
import { ApplyOptions } from '@sapphire/decorators';
import { Route, type RouteOptions } from '@sapphire/plugin-api';

@ApplyOptions<RouteOptions>({ route: 'transcript/:id', methods: ['GET'] })
export class TranscriptRoute extends Route {
public async run(_request: Route.Request, response: Route.Response): Promise<void> {
const { id } = _request.params as { id: string };

// Code...
}
}
I have this as a route and its not registering the route, no errors
Solution:
Always look for a changelog file or releases page on github when updating to a new major version. Major versions always imply some breaking changes https://github.com/sapphiredev/plugins/blob/main/packages/api/CHANGELOG.md#sapphireplugin-api700---2024-11-02. Learn more about semver here: https://semver.org
Semantic Versioning
Semantic Versioning 2.0.0
Semantic Versioning spec and website
GitHub
plugins/packages/api/CHANGELOG.md at main · sapphiredev/plugins
Plugins for the Sapphire Framework. Contribute to sapphiredev/plugins development by creating an account on GitHub.
Jump to solution
2 Replies
Solution
Favna
Favna5d ago
Always look for a changelog file or releases page on github when updating to a new major version. Major versions always imply some breaking changes https://github.com/sapphiredev/plugins/blob/main/packages/api/CHANGELOG.md#sapphireplugin-api700---2024-11-02. Learn more about semver here: https://semver.org
Semantic Versioning
Semantic Versioning 2.0.0
Semantic Versioning spec and website
GitHub
plugins/packages/api/CHANGELOG.md at main · sapphiredev/plugins
Plugins for the Sapphire Framework. Contribute to sapphiredev/plugins development by creating an account on GitHub.
daniel
danielOP5d ago
ah I see thank you!!!

Did you find this page helpful?