-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat]: support content-types from plugins #24
Comments
Hey, thanks for the request! Support for plugins' content-types is definitely something that needs to be addressed, nice catch! However, I'm unsure about the proposed API/implementation, I'm trying to think about a solution that offers both:
For now, in the SDK, it's assumed that there is only one content type per API (based on plural/singular names), but for plugin we might need to reference an extra "source" I'm wondering if something like Happy to discuss it more, cc-ing @jhoward1994 and @maccomaccomaccomacco |
I just used the syntax that you'd use within Strapi. f.e. |
I like this idea @Convly
For core content types we don't provide the SDK full UID's of content types but instead plural names. If we can keep that consistent when interacting with plugins it would be good. |
Plugin content-types don't have core API endpoints by default there is not endpoint we can consider will always exist for a plugin. We cannot offer such capabilities on the content API |
True, the core endpoints are not created by default. But if you follow any documentation, you will create a coreController and coreService for your contentType yourself. But yeah, a check if there are actually Maybe thinking outside of the box; what if we make a marker on the contentType, stating that it follows conventions and is supported by the SDK?
Because for example |
We have mutliple options to explore
|
For me personally, just trying core api's and having a good error, stating that it failed and you ran it with |
Maybe we could handle this as an extension to strapi/strapi#22689
? |
In my opinion, we could start very simple by allowing passing a In a second phase we could leverage the generated SDK schema to serve prog API like What do you think? |
how will you determine the routes though ? /pluginName/name ? |
Yeah that's a good point. I was playing with generated API for plugins and couldn't figure out what would be the best way of doing it. Maybe this needs to wait for the generated prog API? 🤔 Another option could be to use a What do you all think? |
Do you think the generated API will follow the same structure? e.g. I think if we go this way |
I'm not sure I see the point of the plugin(xx).fetch ? just adding a prefix to the url ? simple example put u&p doesn't have API prefixes for ex. what about offering configuration for single & collection fns ?
|
A clear and concise description of what the feature is
contentTypes in plugins are under
/api/<pluginName>/<pluralName>
:)Why should this feature be included?
Because I like my contentTypes in plugins
Please provide an example for how this would work
const articles = sdk.collection('plugin::blog.articles');
The text was updated successfully, but these errors were encountered: