Comments (3)
This is a cool idea! Open to any suggestions on how you'd implement this
from laravel-swagger.
Maybe start the parsing on models... definitions based on models. But some definitions doesn't have models, but if I need to create some unused models, it's acceptable deal for me to create a full & nice documentation.
from laravel-swagger.
For example something like this:
/**
* name {string} Title of post
* lead {string} Short description of content
* content {string} Content of post
* tags {string} Coma-spearated string of tags
* is_active {boolean} Post is active
* lang_id {number} ID of a `Lang` model
* lang {Lang} The attached `Lang` model
*/
class Blog extends Model
{
use SoftDeletes;
protected $table = 'blog';
protected $fillable = [
'name',
'lead',
'content',
'tags',
'is_active',
'lang_id',
];
protected $hidden = ['updated_at', 'deleted_at'];
public function lang() {
return $this->hasOne('App\Lang');
}
}
This format is based on docBlock, and give information about field types too.
number
, string
, boolean
are basic types, and in this example the Lang
is an other model definition.
In this case the swagger definition is based on docBlock and if I miss something to document there it will not show in the final documentation.
from laravel-swagger.
Related Issues (20)
- Ability to add tags HOT 1
- Ability to add description for parameters HOT 1
- Describe response using API Resource HOT 5
- Multipart for file values HOT 1
- mtrajano/laravel-swagger works for Lumen? HOT 1
- Error: "Your requirements could not be resolved to an installable set of packages" HOT 1
- SuccessResponseGenerator is missing methods HOT 3
- Ability to use custom Router provider HOT 1
- Laravel 7 support HOT 10
- missing --filter in 0.7-dev HOT 2
- Command option --filter is broken
- [Proposal] Get additional middlewares defined on controllers HOT 3
- Laravel 8 installation problem HOT 4
- Can't generate when debugger is present
- Auth option for session based internal API
- ReflectionException : Method Modules\Admin\Http\Controllers\CompanyController::destroy() does not exist
- When using --filter the config option basePath it's ignored
- support or update for laravel 8 HOT 1
- PHP 8 deprecation (ReflectionParameter::getClass())
- How to add parameter description and return value description
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-swagger.