nextcloud / neon

A framework for building convergent cross-platform Nextcloud clients using Flutter.
Other
115 stars 27 forks source link

Generate enums from source code #1663

Open provokateurin opened 5 months ago

provokateurin commented 5 months ago

Our helpers currently contain a few enums that are not included in the OpenAPI specs. They are a one to one mapping to the enums defined in the PHP source code, so we should be able to generate them automatically in order to ensure they are always up-to-date: https://github.com/nextcloud/server/blob/master/lib/public/Share/IShare.php https://github.com/nextcloud/news/blob/master/lib/Db/ListType.php https://github.com/nextcloud/spreed/blob/main/lib/Room.php https://github.com/nextcloud/spreed/blob/main/lib/Chat/ChatManager.php https://github.com/nextcloud/spreed/blob/main/lib/Model/Attendee.php https://github.com/nextcloud/spreed/blob/main/lib/Participant.php This will also make it much easier in the future to add new enums if needed.

provokateurin commented 4 months ago

I got a proof of concept working, but it is not so easy as it needs things like detecting keyword collisions which we have already solved in dynamite.

provokateurin commented 4 months ago

For the string enums it would make most sense to patch them into the specs like this: https://github.com/nextcloud/neon/pull/1682