Skip to content

Commit 8dab177

Browse files
committed
docs: example servers configuration for openapi generator and reference plugin
1 parent bbe55b7 commit 8dab177

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

apps/content/docs/openapi/openapi-specification.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,19 @@ const specFromContract = await openAPIGenerator.generate(contract, {
9494
title: 'My App',
9595
version: '0.0.0',
9696
},
97+
servers: [
98+
{ url: 'https://api.example.com/v1', },
99+
],
97100
})
98101

99102
const specFromRouter = await openAPIGenerator.generate(router, {
100103
info: {
101104
title: 'My App',
102105
version: '0.0.0',
103106
},
107+
servers: [
108+
{ url: 'https://api.example.com/v1', },
109+
],
104110
})
105111
```
106112

apps/content/docs/openapi/plugins/openapi-reference.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ const handler = new OpenAPIHandler(router, {
2929
title: 'ORPC Playground',
3030
version: '1.0.0',
3131
},
32+
servers: [ // or let the plugin auto-infer from the request
33+
{ url: 'https://api.example.com/v1', },
34+
],
3235
},
3336
}),
3437
]

0 commit comments

Comments
 (0)