Review OpenAPI property names and placement

Check the property names and locations allowed by each object.

Description

Use the spelling, case and location defined for each OpenAPI 3.0 field. Name application data fields according to the API’s own model.

Potential impact

A misspelled response description can fail validation. A tag description may also disappear from the docs.

Remediation

For custom metadata, use x- where extensions are allowed and check that your tools read it. After correcting a standard field, validate the document and check its generated descriptions.

Examples

These excerpts omit the referenced security scheme exampleSecurity. Supply its definition when validating the full document.

Before

json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "get": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "responses": {
          "200": {
            "descrinnption": "200 response"
          }
        }
      }
    }
  },
  "security": [
    {
      "exampleSecurity": []
    }
  ],
  "tags": [
    {
      "name": "pets",
      "desdddcription": "Everything about your Pets",
      "externalDocs": {
        "url": "http://docs.my-api.com/pet-operations.htm"
      }
    },
    {
      "name": "store",
      "description": "Access to Petstore orders",
      "externalDocs": {
        "url": "http://docs.my-api.com/store-orders.htm"
      }
    }
  ]
}

After

json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "get": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "responses": {
          "200": {
            "description": "200 response"
          }
        }
      }
    }
  },
  "security": [
    {
      "exampleSecurity": []
    }
  ],
  "tags": [
    {
      "name": "pets",
      "description": "Everything about your Pets",
      "externalDocs": {
        "url": "http://docs.my-api.com/pet-operations.htm"
      }
    },
    {
      "name": "store",
      "description": "Access to Petstore orders",
      "externalDocs": {
        "url": "http://docs.my-api.com/store-orders.htm"
      }
    }
  ]
}

Change descrinnption on the 200 response and desdddcription on the pets tag to description. Neither excerpt declares a response body.

References