# Schema names

> Override auto-generated names for inline schemas using the `x-fern-type-name` extension

OpenAPI allows you to define inlined schemas that do not have names.

```yaml title="Inline type in openapi.yml" {11}
components:
  schemas:
    Movie:
      type: object
      properties:
        name:
          type: string
        cast:
          type: array
          items:
            type: object
            properties:
              firstName:
                type: string
              lastName:
                type: string
              age:
                type: integer
```

Fern automatically generates names for all the inlined schemas. For example, in this example,
Fern would generate the name `CastItem` for the inlined array item schema.

```typescript title="Auto-generated name" {6}
export interface Movie {
  name?: string;
  cast?: CastItem[];
}

export interface CastItem {
  firstName?: string;
  lastName?: string;
  age?: integer;
}
```

If you want to override the generated name, you can use the extension `x-fern-type-name`.

```yaml title="openapi.yml" {12}
components:
  schemas:
    Movie:
      type: object
      properties:
        name:
          type: string
        cast:
          type: array
          items:
            type: object
            x-fern-type-name: Person
            properties:
              firstName:
                type: string
              lastName:
                type: string
              age:
                type: integer
```

This would replace `CastItem` with `Person` and the generated code would read more idiomatically:

```typescript title="Overridden name" {6}
export interface Movie {
  name?: string;
  cast?: Person[];
}

export interface Person {
  firstName?: string;
  lastName?: string;
  age?: integer;
}
```