PHPackages                             rogervila/openapi-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. rogervila/openapi-laravel

ActiveLibrary

rogervila/openapi-laravel
=========================

Validate HTTP Requests and Responses with OpenAPI Specs

0.2.0(3y ago)261[3 PRs](https://github.com/rogervila/openapi-laravel/pulls)MITPHP

Since Sep 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rogervila/openapi-laravel)[ Packagist](https://packagist.org/packages/rogervila/openapi-laravel)[ RSS](/packages/rogervila-openapi-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (6)Used By (0)

[![OpenAPI Laravel](https://camo.githubusercontent.com/100331f845810584a422ba353d8c0547307d3714e8dfb2828df7e540aafa5f80/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4f70656e4150492532304c61726176656c2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d726f67657276696c612532466f70656e6170692d6c61726176656c267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d56616c69646174652b4c61726176656c2b485454502b52657175657374732b616e642b526573706f6e7365732b776974682b4f70656e4150492b5370656373266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d736869656c642d636865636b)](https://camo.githubusercontent.com/100331f845810584a422ba353d8c0547307d3714e8dfb2828df7e540aafa5f80/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4f70656e4150492532304c61726176656c2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d726f67657276696c612532466f70656e6170692d6c61726176656c267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d56616c69646174652b4c61726176656c2b485454502b52657175657374732b616e642b526573706f6e7365732b776974682b4f70656e4150492b5370656373266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d736869656c642d636865636b)

[![Build Status](https://github.com/rogervila/openapi-laravel/workflows/build/badge.svg)](https://github.com/rogervila/openapi-laravel/actions)[![StyleCI](https://camo.githubusercontent.com/603a1e8321f85d729f0ec7a51d0e733e4d335b594a4d07356c1684e724d7c841/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3533343737343939342f736869656c643f6272616e63683d6d61696e)](https://github.styleci.io/repos/534774994)

[![Latest Stable Version](https://camo.githubusercontent.com/9661a771fce83284cbd525680256854132b943a2411b671e85dedb1d7921eab3/68747470733a2f2f706f7365722e707567782e6f72672f726f67657276696c612f6f70656e6170692d6c61726176656c2f762f737461626c65)](https://packagist.org/packages/rogervila/openapi-laravel)[![Total Downloads](https://camo.githubusercontent.com/025ba99caac7f4dbc92e80539f8b0601df61736263445f2e91fee9b8681aaa7a/68747470733a2f2f706f7365722e707567782e6f72672f726f67657276696c612f6f70656e6170692d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/rogervila/openapi-laravel)[![License](https://camo.githubusercontent.com/204eb10ed7ed21f674c3f4562521db723f6b8d0aef004e12b55e7759eb0e9392/68747470733a2f2f706f7365722e707567782e6f72672f726f67657276696c612f6f70656e6170692d6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/rogervila/openapi-laravel)

OpenAPI Laravel
===============

[](#openapi-laravel)

About
-----

[](#about)

Validate HTTP Requests and Responses with OpenAPI Specs.

Install
-------

[](#install)

Require the package with composer.

```
composer require rogervila/openapi-laravel
```

Laravel will autodiscover the service provider located in `\LaravelOpenAPI\ServiceProvider`.

Setup
-----

[](#setup)

The package handles HTTP requests via Specification and Request classes.

### OpenAPI Specifications

[](#openapi-specifications)

First, create a Specification class.

```
# The namespace is optional, you can place specification classes anywhere.
php artisan openapi:make-specification Specifications/PetsSpecification
```

```
