# easy-validation-for-openapi
Source: https://speakeasy.com/blog/easy-validation-for-openapi


New Year means new product shipping!

When you encounter an error while troubleshooting, you want to know **where** the error occurred and **what** caused it. Anyone who's tried to do code generation from an OpenAPI spec is unfortunately very familiar with the anguish of hunting through a thousand-line yaml file to track down opaque errors without line numbers to guide you.

With the latest release of our CLI, that should hopefully be a problem of the past. We've baked in an OpenAPI validator that will help you optimize your spec for code generation workflows and make troubleshooting any issues a breeze. See it in action below.

### **New Features**

**OpenAPI Validation** - OpenAPI validation is baked into [our SDK generator](/docs/sdks/create-client-sdks/), but can also be used on its own: `speakeasy validate openapi -s openapi.yaml`. The validator provides you with both `warnings`: implementation that is bad practice, but not incorrect and `errors`: implementation that violates the OpenAPI spec. The best part is that the warnings and errors returned are actionable. The error messages are human-readable, and include a line number to make it easy to track down:

```yaml
Error: validation error: [line 12] validate-servers - Server URL is not valid: no hostname or path provided
```

<video controls={false} loop={true} autoPlay={true} muted={true} width="100%">
  <source src="/assets/videos/openapi-validation.mp4" type="video/mp4" />
</video>

To try it out yourself, download the CLI:

```bash
***brew install speakeasy-api/tap/speakeasy***
```

```bash
***speakeasy validate openapi -s openapi.yaml***
```