yiisoft / yii-gii

Yii code generator extension
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
33 stars 18 forks source link

API Generator (Feature request) #3

Open jonny7 opened 6 years ago

jonny7 commented 6 years ago

This is feature request for 3.0. I wondered about having Gii include an API generator/Template. I think Gii is great! But I haven't been able to see a way to generate a base API. But something that could analyse models and relations as Gii does and then create potentially Repository Pattern or JSON API style or similar based off those would be a cool concept. Spring has something similar where you can use their starter wizard in combination with JPA to generate entities etc.

No worries, if you don't think this is a good idea :slightly_smiling_face:

cebe commented 5 years ago

I am currently working on a generator that will take an OpenAPI 3 spec and generate database, models, controllers from it. The base work is happening in https://github.com/cebe/php-openapi/

Other forms of generating API code are also possible.

xepozz commented 4 years ago

@cebe How your progress? will It be compatible with yii3?

cebe commented 4 years ago

See https://github.com/cebe/yii2-app-api, it is currently Yii2 only.