An open API service indexing awesome lists of open source software.

https://github.com/jansdhillon/landscape-openapi-spec

OpenAPI specification for Landscape Server's API
https://github.com/jansdhillon/landscape-openapi-spec

landscape openapi

Last synced: 23 days ago
JSON representation

OpenAPI specification for Landscape Server's API

Awesome Lists containing this project

README

          

# landscape-openapi-spec

[![Bundle and sync API Client with OpenAPI spec, publish GitHub release/Go package](https://github.com/jansdhillon/landscape-openapi-spec/actions/workflows/sync-client.yaml/badge.svg)](https://github.com/jansdhillon/landscape-openapi-spec/actions/workflows/sync-client.yaml)

OpenAPI 3.1 specification for the Landscape Server API.

## Validating, linting, and bundling

Make sure you have `swagger-cli` and `spectral-cli` installed:

```sh
npm install -g @apidevtools/swagger-cli @stoplight/spectral-cli
```

Then, you can use the `make` recipes to validate, lint, and bundle the OpenAPI spec.

Validate:

```sh
make validate
```

Lint:

```sh
make lint
```

Generate bundle in `openapi/landscape_api.bundle.yaml`:

```sh
make bundle
```

Example usage: .

## Syncing

Whenever a new version of the OpenAPI spec is created and pushed to `main`, [a GitHub Actions workflow](./.github/workflows/sync-client.yaml) is triggered that bundles the OpenAPI spec, creates a release for that version in this repository and the Go client (with the bundle as an artifact), and uses the new bundle to open a PR on `landscape-go-api-client` to update the generated code. The workflow also syncs the Go package with [pkg.go.dev](https://pkg.go.dev/github.com/jansdhillon/landscape-go-api-client).