# ...
```

The schema using an external file reference instead of `components`:

```yaml filename="openapi.yaml"
      parameters:
        - $ref: 'parameters.yaml#/DrinkTypeParameter'
```

The contents of the referenced `parameters.yaml` file (note that the main schema file is referenced in turn from the `openapi.yaml` file):

```yaml filename="parameters.yaml"
DrinkTypeParameter:
  name: type
  in: query
  description: The type of drink to filter by. If not provided all drinks will be returned.
  required: false
  schema:
    $ref: 'openapi.yaml#/components/schemas/DrinkType'
```

### Referencing Request Bodies in OpenAPI

The `requestBody` for the operation `authenticate`:

```yaml filename="openapi.yaml"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                username:
                  type: string
                password:
                  type: string
```

The same schema using a reference to the `components` section:

```yaml filename="openapi.yaml" 
      requestBody:
        $ref: '#/components/requestBodies/UserCredentials'