# Info in OpenAPI best practices

# Info Object in OpenAPI

The document's `info` object contains information about the document, including fields like `title`, `version`, and `description` that help to identify the purpose and owner of the document.

Example:

```yaml
openapi: 3.1.0
info:
  title: The Speakeasy Bar
  version: 1.0.0
  summary: A bar that serves drinks
  description: A secret underground bar that serves drinks to those in the know.
  contact:
    name: Speakeasy Support
    url: https://support.speakeasy.bar
    email: support@speakeasy.bar
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: https://speakeasy.bar/terms
```

<Table
  data={[
    { field: "`title`", type: "String", required: "✅", description: "A name for the API contained within the document." },
    { field: "`version`", type: "String", required: "✅", description: "The version of this OpenAPI document, _not_ the version of the API or the OpenAPI Specification used. This is recommended to be a [Semantic Version](https://semver.org/)." },
    { field: "`summary`", type: "String", required: "", description: "**(Available in OpenAPI 3.1.x ONLY)**<br />A short sentence summarizing the API contained with the document." },
    { field: "`description`", type: "String", required: "", description: "A longer description of the API contained within the document. This may contain [CommonMark syntax](https://spec.commonmark.org/) to provide a rich description." },
    { field: "`contact`", type: "[Contact Object](#contact-object)", required: "", description: "Contact information for the maintainer of the API.<br /><br /> **Note:** Currently not supported by Speakeasy tooling." },
    { field: "`license`", type: "[License Object](#license-object)", required: "", description: "The license the API is made available under." },
    { field: "`termsOfService`", type: "String", required: "", description: "A URL to the terms of service for the API." },
    { field: "`x-*`", type: "[Extensions](/openapi/extensions)", required: "", description: "Any number of extension fields can be added to the info object that can be used by tooling and vendors to add additional metadata and functionality to the OpenAPI Specification." }
  ]}
  columns={[
    { key: "field", header: "Field" },
    { key: "type", header: "Type" },
    { key: "required", header: "Required" },
    { key: "description", header: "Description" }
  ]}
/>

The above order of fields is recommended (but is not required by the OpenAPI specification) as it puts the most important information first and allows the reader to get a quick overview of the document and API.

## Contact Object in OpenAPI

Contact information for the maintainer of the API.

## License Object in OpenAPI

The license the API is made available under.

<Table
  data={[
    { field: "`name`", type: "String", required: "✅", description: "The name of the license." },
    { field: "`identifier`", type: "String", required: "", description: "**(Available in OpenAPI 3.1.x ONLY)**<br/>An [SPDX identifier](https://spdx.org/licenses/) for the license. Provided only if `url` isn't set." },
    { field: "`url`", type: "String", required: "", description: "A URL to the license information. Provided only if `identifier` isn't set." },
    { field: "`x-*`", type: "[Extensions](/openapi/extensions)", required: "", description: "Any number of extension fields can be added to the license object that can be used by tooling and vendors." }
  ]}
  columns={[
    { key: "field", header: "Field" },
    { key: "type", header: "Type" },
    { key: "required", header: "Required" },
    { key: "description", header: "Description" }
  ]}
/>
