Category «Swagger»

How to send json data request to api use Postman or Swager

In postman: Set header Content-Type to application/json Set body request type to raw, content must be json format, eg. { “msg”:{“address”: {“street”: “end”, “number”: 31, “road”: 2, “suburb”: “hillcrest”}, “price”: 23380,”on_market_time”: “2018-09-03T19:42:19.296591”} } In Swager: By default, the Content-Type is already set to application/json Set body value must be json format, eg. { “msg”:{“address”: {“street”: …

Add securityDefinitions Oauth2 to Swagger-PHP

Add securityDefinitions Oauth2 to Swagger-PHP / Infyom(AppBaseController.php) // “securityDefinitions”: { // “extraction_auth”: { // “type”: “oauth2”, // “tokenUrl”: “/oauth/token”, // “flow”: “password”, // “scopes”: [] // } // }, // “security”: [{“extraction_auth”:[] }],   // “securityDefinitions”: { // “extraction_auth”: { // “type”: “oauth2”, // “tokenUrl”: “/oauth/token”, // “flow”: “password”, // “scopes”: [] // } // …

Generate Swagger API Docs with Oauth2 Authorize from JSON file in a single HTML page

Use swagger-ui-bundle.js to generate Swagger API Docs with Oauth2 Authorize from JSON file in a single HTML page: <html> <head> <title>Swagger API Docs with Oauth2 Authorize</title> <linkrel=”stylesheet”href=”//unpkg.com/[email protected]/swagger-ui.css”> <scriptsrc=”//unpkg.com/[email protected]/swagger-ui-bundle.js”></script> <scriptsrc=”//unpkg.com/[email protected]/swagger-ui-standalone-preset.js”></script> <script> functionrender() { varui = SwaggerUIBundle({ url:`./swagger-api.json?a=1`, dom_id:’#swagger-ui’, deepLinking:true, presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ], plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], //layout: “StandaloneLayout” }); } </script> </head> <bodyonload=”render()”> <divid=”swagger-ui”></div> …

Infyom Laravel Code Generator, Generate CRUD, APIs Code

Infyom Laravel Code Generator  to generate CRUD, APIs, Test Cases and Swagger Documentation support Laravel 5.6, good for API+Swagger http://labs.infyom.com/laravelgenerator/docs better laravel crud, API, generator. include swagger api docs ==== ############ Commands examples:  ############ php artisan infyom:api User –fromTable –tableName=users –paginate=20 –save php artisan infyom:api MqttMsg –fromTable –tableName=mqtt_msgs –paginate=20 –save php artisan infyom:api Extractee –fromTable –tableName=extractees …