Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint OpenAPI spec

on:
pull_request:
paths:
- 'openapi.yaml'
- '.yamlfmt'
push:
branches:
- main
paths:
- 'openapi.yaml'
- '.yamlfmt'

permissions:
contents: read

jobs:
yamlfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install yamlfmt
run: |
go install github.com/google/yamlfmt/cmd/yamlfmt@latest
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH

- name: Check YAML formatting
run: yamlfmt -dry -conf .yamlfmt openapi.yaml
6 changes: 6 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
formatter:
type: basic
indent: 2
retain_line_breaks: true
retain_line_breaks_multi: true
line_ending: lf
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ The OpenAPI specification offers a structured and clear format for API design. W
Contact us: https://www.together.ai/contact

Terms of Service: https://www.together.ai/terms-of-service

## Development

### YAML Formatting

This repo uses [yamlfmt](https://github.com/google/yamlfmt) to keep `openapi.yaml` consistently formatted. CI will fail if the file is not formatted.

```sh
go run github.com/google/yamlfmt/cmd/yamlfmt@latest -conf .yamlfmt openapi.yaml
```
Loading
Loading