# FidesCtl API Types

**Do not manually edit these files.**

The TypeScript files in this directory are auto-generated by OpenAPI. This ensures our frontend uses the same schema as the backend without needing to manually convert Python classes to TypeScript. Currently, we only generate model types.

Use these types working with API requests & responses, for example:

```ts
import { DatasetField } from "~/types/api";
```

## Updating

These files can by regenerated by running:

```
turbo run openapi:generate
```

**The Fides server must be running on `localhost:8080`**. This will read the schema hosted at <http://localhost:8080/docs> and generate all TS files under `clients/admin-ui/src/types/api/`.

You will also likely need to follow this by running `format`, in order to ensure the generated files are formatted correctly:

```
turbo run format
```

## Resources

- [FastAPI Client Generation](https://fastapi.tiangolo.com/advanced/generate-clients/?h=typescript#install-openapi-typescript-codegen)
- [OpenAPI Typescript Codegen](https://github.com/ferdikoomen/openapi-typescript-codegen)
