Closed icanhazpython closed 1 year ago
Thanks for reporting the issue and giving your suggestion. I did think about querying strapi at some point when developing this, but was very unsure how. I will definitely try to look into querying it in this way.
any updates on this?
Sorry no, I have been busy with other porjects. Feel free to open a PR :)
Update: I am working on this now, should probably be ready this week
Alright, v1 makes it possible to use different readers. The v0 reader would only read the generated files by strapi.
v1 keeps it this way by default, but introduces another reader named load-strapi
you should use this reader if you have relations to users or other content types not defined by the files.
example with cli
t4s --reader load-strapi
I will publish v1 today after I have made some tests
On a bog-standard fresh-out-of-the-box strapi v4.7.1 install, create a collection type that contains a relation to the users collection. Types-4-strapi-2 will throw this exception because the users collection does not exist on the filesystem (presumably it is part of strapi internals and stored elsewhere):
This is one reason why I'm curious that this project doesn't simply query the strapi content-types API at
api/content-type-builder/content-types
. It would seem that the return data provides all that analyzing the json schemas from the filesystem would, with the addition of the schema for the users objects (displayed in the API response asplugin::users-permissions.user
). In my case, I have added additional fields to the user object, so this tool has a blind spot there, as that data appears to be only available via the API and not the json schema files on the filesystem.