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
5 changes: 5 additions & 0 deletions .changeset/soft-penguins-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hey-api/openapi-ts': patch
---

feat(input): input supports Hey API Registry shorthand
8 changes: 4 additions & 4 deletions docs/openapi-ts/clients/angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-angular`

```js [config]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: ['@hey-api/client-angular'], // [!code ++]
};
```

```sh [cli]
npx @hey-api/openapi-ts \
-i https://get.heyapi.dev/hey-api/backend \
-i hey-api/backend \
-o src/client \
-c @hey-api/client-angular # [!code ++]
```
Expand Down Expand Up @@ -105,7 +105,7 @@ Since `client.gen.ts` is a generated file, we can't directly modify it. Instead,

```js
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: [
{
Expand Down Expand Up @@ -178,7 +178,7 @@ export class FooService {

```js [config]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: [
'@hey-api/client-angular',
Expand Down
8 changes: 4 additions & 4 deletions docs/openapi-ts/clients/angular/v19.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-angular`

```js [config]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: ['@hey-api/client-angular'], // [!code ++]
};
```

```sh [cli]
npx @hey-api/openapi-ts \
-i https://get.heyapi.dev/hey-api/backend \
-i hey-api/backend \
-o src/client \
-c @hey-api/client-angular # [!code ++]
```
Expand Down Expand Up @@ -105,7 +105,7 @@ Since `client.gen.ts` is a generated file, we can't directly modify it. Instead,

```js
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: [
{
Expand Down Expand Up @@ -178,7 +178,7 @@ export class FooService {

```js [config]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: [
'@hey-api/client-angular',
Expand Down
6 changes: 3 additions & 3 deletions docs/openapi-ts/clients/axios.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-axios` to

```js [config]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: ['@hey-api/client-axios'], // [!code ++]
};
```

```sh [cli]
npx @hey-api/openapi-ts \
-i https://get.heyapi.dev/hey-api/backend \
-i hey-api/backend \
-o src/client \
-c @hey-api/client-axios # [!code ++]
```
Expand Down Expand Up @@ -87,7 +87,7 @@ Since `client.gen.ts` is a generated file, we can't directly modify it. Instead,

```js
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: [
{
Expand Down
6 changes: 3 additions & 3 deletions docs/openapi-ts/clients/fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-fetch` to

```js [config]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: ['@hey-api/client-fetch'], // [!code ++]
};
```

```sh [cli]
npx @hey-api/openapi-ts \
-i https://get.heyapi.dev/hey-api/backend \
-i hey-api/backend \
-o src/client \
-c @hey-api/client-fetch # [!code ++]
```
Expand Down Expand Up @@ -86,7 +86,7 @@ Since `client.gen.ts` is a generated file, we can't directly modify it. Instead,

```js
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: [
{
Expand Down
10 changes: 5 additions & 5 deletions docs/openapi-ts/clients/legacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,39 @@ Before client packages, clients were generated using `@hey-api/openapi-ts`. In f

```js [fetch]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: ['legacy/fetch'], // [!code ++]
};
```

```js [axios]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: ['legacy/axios'], // [!code ++]
};
```

```js [angular]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: ['legacy/angular'], // [!code ++]
};
```

```js [node]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: ['legacy/node'], // [!code ++]
};
```

```js [xhr]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: ['legacy/xhr'], // [!code ++]
};
Expand Down
6 changes: 3 additions & 3 deletions docs/openapi-ts/clients/next-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-next` to

```js [config]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: ['@hey-api/client-next'], // [!code ++]
};
```

```sh [cli]
npx @hey-api/openapi-ts \
-i https://get.heyapi.dev/hey-api/backend \
-i hey-api/backend \
-o src/client \
-c @hey-api/client-next # [!code ++]
```
Expand All @@ -56,7 +56,7 @@ Since `client.gen.ts` is a generated file, we can't directly modify it. Instead,

```js
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: [
{
Expand Down
6 changes: 3 additions & 3 deletions docs/openapi-ts/clients/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-nuxt` to

```js [config]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: ['@hey-api/client-nuxt'], // [!code ++]
};
```

```sh [cli]
npx @hey-api/openapi-ts \
-i https://get.heyapi.dev/hey-api/backend \
-i hey-api/backend \
-o src/client \
-c @hey-api/client-nuxt # [!code ++]
```
Expand Down Expand Up @@ -111,7 +111,7 @@ Since `client.gen.ts` is a generated file, we can't directly modify it. Instead,

```js
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
plugins: [
{
Expand Down
24 changes: 16 additions & 8 deletions docs/openapi-ts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ description: Configure @hey-api/openapi-ts.
import { defineConfig } from '@hey-api/openapi-ts';

export default defineConfig({
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
});
```

```js [openapi-ts.config.cjs]
/** @type {import('@hey-api/openapi-ts').UserConfig} */
module.exports = {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
};
```

```js [openapi-ts.config.mjs]
/** @type {import('@hey-api/openapi-ts').UserConfig} */
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client',
};
```
Expand Down Expand Up @@ -65,7 +65,9 @@ export default defineConfig([

## Input

You must set the input so we can load your OpenAPI specification. It can be a path or URL, object containing a path or URL, or an object representing an OpenAPI specification. Hey API supports all valid OpenAPI versions and file formats.
You must provide an input so we can load your OpenAPI specification.

The input can be a string path, URL, API registry shorthand, an object containing any of these, or an object representing an OpenAPI specification. Hey API supports all valid OpenAPI versions and file formats.

You can learn more on the [Input](/openapi-ts/configuration/input) page.

Expand All @@ -79,15 +81,21 @@ export default {

```js [url]
export default {
input: 'https://get.heyapi.dev/hey-api/backend', // [!code ++]
input: 'https://get.heyapi.dev/hey-api/backend', // sign up at app.heyapi.dev // [!code ++]
};
```

```js [registry]
export default {
input: 'hey-api/backend', // sign up at app.heyapi.dev // [!code ++]
};
```

<!-- prettier-ignore-start -->
```js [object]
export default {
input: { // [!code ++]
path: 'https://get.heyapi.dev/hey-api/backend', // [!code ++]
path: 'hey-api/backend', // sign up at app.heyapi.dev // [!code ++]
// ...other options // [!code ++]
}, // [!code ++]
};
Expand Down Expand Up @@ -120,15 +128,15 @@ You can learn more on the [Output](/openapi-ts/configuration/output) page.

```js [path]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: 'src/client', // [!code ++]
};
```

<!-- prettier-ignore-start -->
```js [object]
export default {
input: 'https://get.heyapi.dev/hey-api/backend',
input: 'hey-api/backend', // sign up at app.heyapi.dev
output: { // [!code ++]
path: 'src/client', // [!code ++]
// ...other options // [!code ++]
Expand Down
Loading
Loading