Skip to content

Commit

Permalink
Merge pull request #58 from hookdeck/refactor/structure
Browse files Browse the repository at this point in the history
refactor: bring OpenAPI spec to top-level
  • Loading branch information
leggetter authored Sep 2, 2024
2 parents 923cefd + cc4ed67 commit b48b655
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Fetch Hookdeck OpenAPI
name: Check Hookdeck OpenAPI for Changes
on:
workflow_dispatch: # Manually trigger the workflow
schedule:
- cron: "*/15 * * * *"

permissions:
contents: write
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Hookdeck OpenAPI Schema

In addition to the standard uses of OpenAPI schema, the Hookdeck OpenAPI schema is used to generate our SDKS:
In addition to the standard uses of OpenAPI schema, the Hookdeck OpenAPI schema is used to generate our SDKS using [Fern](https://www.buildwithfern.com/?ref=hookdeck):

- [Go SDK](https://github.com/hookdeck/hookdeck-go-sdk)
- [TypeScript SDK](https://github.com/hookdeck/hookdeck-typescript-sdk)
- _More SDKs to come..._

## What is in this repository?

This repository contains

- Hookdeck's Fern API Definition which lives in the [OpenApi](./fern/openapi/) folder
- Generators (see [generators.yml](./fern/generators.yml))
- Hookdeck's API Definition which lives in the root directory and contains some Fern specific extensions
- Generators used to generate the SDK (see [generators.yml](./fern/generators.yml))

## About Fern

Fern is used to generate our SDKs from the OpenAPI specification.

In order to make sure that the definition is valid, you can use the Fern CLI.

Expand All @@ -20,27 +23,27 @@ npm install -g fern-api # Installs CLI
fern check # Checks if the definition is valid
```

## What are Generators?
### What are Generators?

Generators read in your API Definition and output files or code (i.e. the TypeScript SDK Generator) and are tracked in [generators.yml](./fern/generators.yml).

### Local preview
#### Local preview

You can preview the generated code in the `./local/go/generated/hookdeck-go-sdk` directory by running the following command:

```sh
fern generate --group local
```

## Validating your API Definition
### Validating your API Definition

To validate your API, run:
```sh
npm install -g fern-api # only required once
fern check
```

## Updating your SDKs
### Updating your SDKs

To update your SDKs, run `fern generate`.

Expand Down
2 changes: 1 addition & 1 deletion fern/generators.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
api:
path: ./openapi/openapi.json
path: ../openapi.json
overrides: ../overrides.yml
origin: https://api.hookdeck.com/latest/openapi/fern
groups:
Expand Down
File renamed without changes.

0 comments on commit b48b655

Please sign in to comment.