Support Payload api route config#77
Conversation
…operation base paths
… hardcoding /api, add another test to check if the payload api route config works
…ches due to previously missing zed config
|
@janbuchar Glad to support the project! Unfortunately I missed this PR. It is very close to mine. The only difference is, that my approach allows the apiBasePath to bet set freely in the plugin options. Otherwise it defaults to the currently configured Payload api route. Sorry for any inconvenience. I updated my PR, because I liked the idea of the previous PR to use the sanitized payload config from the req object to avoid hardcoding "/api". I also added a second test to properly test changes to the Payload config. |
There was a problem hiding this comment.
I'd prefer not to include editor specific config files in the repo, I don't use Zed personally and there's not config for VSCode, either 🙂
The current implementation always uses
/apias base path for all Payload routes. This will produce an invalid spec if the Payload config uses routes.api to customize the api route path. This PR fixes the issue and adds the possibility to customize it completely.