Swagger With Laravel Based RESTful API

Submitted by azazqadir - 1 year ago

Swagger is a language/framework agnostic ecosystem to produce and visualize RESTful APIs. These days, Laravel and Lumen are becoming the most widely used frameworks for creating PHP based web apps and APIs, and we were expecting some out of the box support for these in swagger but couldn’t find any. For more information you can read this article: http://www.cloudways.com/blog/use-swagger-with-laravel-based-restful-api/

info:  
  title: Cloudways API  
  description: Move your app forward with the Cloudways API  
  version: "1.0.0"  
host:  cloudways.com
schemes:  
  - http  
basePath: /api/v1  
produces:  
  - application/json  
tags:  
- name: "User"  
- name: "Authentication"  
  description: "API Authentication related calls"  
paths:  
  /auth/login:  
    post:  
      summary: Login user   
      description:   
      tags:  
        - Authentication  
      parameters:  
        - $ref: 'params.yaml#/EmailPost'  
        - $ref: 'params.yaml#/PasswordPost'  
          
  /user:  
    post:  
      summary: Create a new user   
      description:   
      tags:  
        - User  
      parameters:  
        - $ref: 'params.yaml#/NamePost'  
        - $ref: 'params.yaml#/EmailPost'  
        - $ref: 'params.yaml#/PasswordPost'  
      responses:  
            200:  
              $ref: 'responses.yaml#/BasicSuccess'    

Ads cover the costs of maintaining Laravel-tricks

comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks