Skip to Content
Native GitRepository Files Organization

Repository Files Organization

When you access an API repository, all files are organized into three categories. You can easily switch between these groups using the tabs in the upper right corner:

  • API & Documents
  • Mock Scripts
  • All Files

Since the API repository is a Git repository, all files are under version control. The categorization into different tabs is simply to facilitate easier management. You can always navigate to the All Files tab to view and manage all files without any filtering.

All Files tab listing the folders and files of the repository with their last commits

API & Documents

Files with the following characteristics are considered API document-related:

  • Extensions: .json, .yaml, .yml, .md, or .mdx
  • Not located in the /apigit-mock folder

These files fall into two main categories:

  • API Specification files must have .json, .yaml or .yml extensions
  • Documentation files must have .md or .mdx extensions

In the API & Documents tab, both file types are filtered and displayed in the left sidebar. You can use the visual editor or viewer to manage these files. Later, you can publish these files to build API specification and Markdown-based documentation sites.

API & Documents tab with the orders.yaml specification open in the viewer

Mock Scripts

Mock server-related files must follow these requirements:

  • Located in the /apigit-mock folder
  • Have .js extension

These files define mock routes and their handling logic, and are used by code-based mock servers, which run on Express.js. Spec-based mock servers need no scripts: they serve your API documents directly. In the Mock Scripts tab, these files are filtered and displayed in the left sidebar, where you can use the visual editor to manage your mock scripts.

Mock Scripts tab with main.js open and its routes listed on the right

Working with Files in the Tree

The sidebar of the API & Documents and Mock Scripts tabs is a file tree:

  • The + button adds a file. In API & Documents you can add an OpenApi Spec, a Json Schema Spec, a Markdown Document or the Navigation (apigit.json) file.
  • The menu of a file offers Rename, Duplicate, Edit and Delete. The entry script apigit-mock/main.js cannot be renamed or deleted.

Working in All Files

The All Files tab browses the repository by folder and shows the last commit of each entry.

  • Add file offers Create new file and Upload a file.
  • Open a file and click Edit file to change it, then Commit Changes.
  • A file that is too large to preview shows a Download file button instead.
Last updated on