Giter VIP home page Giter VIP logo

Comments (3)

mtrajano avatar mtrajano commented on June 1, 2024

This is a cool idea! Open to any suggestions on how you'd implement this

from laravel-swagger.

netdjw avatar netdjw commented on June 1, 2024

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.

netdjw avatar netdjw commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.