Skip to content

Commit 2a0c798

Browse files
authored
Merge pull request #2489 from hey-api/fix/api-registry-shorthand
feat(input): input supports Hey API Registry shorthand
2 parents c74279c + 9bfbb63 commit 2a0c798

File tree

43 files changed

+658
-570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+658
-570
lines changed

.changeset/soft-penguins-fetch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': patch
3+
---
4+
5+
feat(input): input supports Hey API Registry shorthand

docs/openapi-ts/clients/angular.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-angular`
4949

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

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

106106
```js
107107
export default {
108-
input: 'https://get.heyapi.dev/hey-api/backend',
108+
input: 'hey-api/backend', // sign up at app.heyapi.dev
109109
output: 'src/client',
110110
plugins: [
111111
{
@@ -178,7 +178,7 @@ export class FooService {
178178

179179
```js [config]
180180
export default {
181-
input: 'https://get.heyapi.dev/hey-api/backend',
181+
input: 'hey-api/backend', // sign up at app.heyapi.dev
182182
output: 'src/client',
183183
plugins: [
184184
'@hey-api/client-angular',

docs/openapi-ts/clients/angular/v19.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-angular`
4949

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

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

106106
```js
107107
export default {
108-
input: 'https://get.heyapi.dev/hey-api/backend',
108+
input: 'hey-api/backend', // sign up at app.heyapi.dev
109109
output: 'src/client',
110110
plugins: [
111111
{
@@ -178,7 +178,7 @@ export class FooService {
178178

179179
```js [config]
180180
export default {
181-
input: 'https://get.heyapi.dev/hey-api/backend',
181+
input: 'hey-api/backend', // sign up at app.heyapi.dev
182182
output: 'src/client',
183183
plugins: [
184184
'@hey-api/client-angular',

docs/openapi-ts/clients/axios.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-axios` to
4646

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

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

8888
```js
8989
export default {
90-
input: 'https://get.heyapi.dev/hey-api/backend',
90+
input: 'hey-api/backend', // sign up at app.heyapi.dev
9191
output: 'src/client',
9292
plugins: [
9393
{

docs/openapi-ts/clients/fetch.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-fetch` to
3939

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

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

8787
```js
8888
export default {
89-
input: 'https://get.heyapi.dev/hey-api/backend',
89+
input: 'hey-api/backend', // sign up at app.heyapi.dev
9090
output: 'src/client',
9191
plugins: [
9292
{

docs/openapi-ts/clients/legacy.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,39 @@ Before client packages, clients were generated using `@hey-api/openapi-ts`. In f
1919

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

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

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

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

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

docs/openapi-ts/clients/next-js.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-next` to
2929

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

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

5757
```js
5858
export default {
59-
input: 'https://get.heyapi.dev/hey-api/backend',
59+
input: 'hey-api/backend', // sign up at app.heyapi.dev
6060
output: 'src/client',
6161
plugins: [
6262
{

docs/openapi-ts/clients/nuxt.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ In your [configuration](/openapi-ts/get-started), add `@hey-api/client-nuxt` to
6464

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

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

112112
```js
113113
export default {
114-
input: 'https://get.heyapi.dev/hey-api/backend',
114+
input: 'hey-api/backend', // sign up at app.heyapi.dev
115115
output: 'src/client',
116116
plugins: [
117117
{

docs/openapi-ts/configuration.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ description: Configure @hey-api/openapi-ts.
1313
import { defineConfig } from '@hey-api/openapi-ts';
1414

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

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

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

6666
## Input
6767

68-
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.
68+
You must provide an input so we can load your OpenAPI specification.
69+
70+
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.
6971

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

@@ -79,15 +81,21 @@ export default {
7981

8082
```js [url]
8183
export default {
82-
input: 'https://get.heyapi.dev/hey-api/backend', // [!code ++]
84+
input: 'https://get.heyapi.dev/hey-api/backend', // sign up at app.heyapi.dev // [!code ++]
85+
};
86+
```
87+
88+
```js [registry]
89+
export default {
90+
input: 'hey-api/backend', // sign up at app.heyapi.dev // [!code ++]
8391
};
8492
```
8593

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

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

128136
<!-- prettier-ignore-start -->
129137
```js [object]
130138
export default {
131-
input: 'https://get.heyapi.dev/hey-api/backend',
139+
input: 'hey-api/backend', // sign up at app.heyapi.dev
132140
output: { // [!code ++]
133141
path: 'src/client', // [!code ++]
134142
// ...other options // [!code ++]

0 commit comments

Comments
 (0)