OpenAPI Required Fields Check

Before you hand an API description to a teammate, a client or a docs generator, make sure the required fields are in place. Paste your document above and the tool confirms the version field, info.title, info.version and paths, listing anything missing.

How to check the required fields

  1. 1

    Paste the document

    Paste your spec as JSON or YAML, even if it is still a work in progress.

  2. 2

    Run the check

    Continue to the results step. Each missing field appears as its own error.

  3. 3

    Add what is missing

    Add the listed fields to your file using the snippets below.

  4. 4

    Recheck

    Paste the updated spec and run it again until no errors are shown.

The four required pieces

Field Where it goes Example
Version field Top level openapi: 3.0.3 or swagger: "2.0"
info.title Inside info title: Orders API
info.version Inside info version: 1.0.0
paths Top level paths: with at least your first route

The info.version value is the version of your own API, not of the OpenAPI specification. People often leave it out because the spec version is already at the top.

A worked example with everything missing

servers:
  - url: https://api.example.com

This tiny document has none of the required pieces. The report lists three errors:

Finding Type
Missing ‘openapi’ or ‘swagger’ version field. Error
Missing ‘info’ object. Error
Missing ‘paths’ object. Error

When the whole info object is absent, the tool reports that one error and does not also list the title and version separately. Add info with both fields and the next run will report them if either is still missing.

Starter skeleton

openapi: 3.0.3
info:
  title: Orders API
  version: 1.0.0
paths:
  /orders:
    get:
      summary: List orders

This skeleton clears every required-field check. Replace the names with your own and build outward from there. Responses, schemas and security are not part of this check.

When to run this check

Run it when you start a new spec from scratch, after generating one from code, and before sending it to anyone who will import it into another tool. Many importers stop at the first missing required field with a short message, so catching all of them in one pass saves several round trips. It is also a handy reminder for newcomers, who often forget info.version or leave paths out while sketching an API.

After the required fields pass, the next useful additions are a short description under info, a servers entry and an operationId on each operation. None of these are checked here, but they make the spec easier to read and to turn into client code.

Frequently Asked Questions

No. The openapi field states which version of the specification you use. info.version is the version of your own API, such as 1.0.0.

The key must exist as an object, and this check does not require any routes inside it. Add real routes before you publish.

The title and version checks run only when the info object exists. Add it, then rerun to see whether its fields are complete.

No. Only the version field, info, title, version and paths are required here. Operation-level details are not examined.

Related Tools

Tool available in other languages

Guides and use cases