Skip to content

Commit fceb998

Browse files
committed
server: add $remote.withSchema
1 parent 7b757bb commit fceb998

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/server/src/descriptors/$remote.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ export interface RemoteDescriptorOptions {
5454
* This will be used for internal communication and will not be exposed to the client.
5555
*/
5656
serviceAccount?: ServiceAccountDescriptor;
57+
58+
/**
59+
* If true, all actions will come with body / response schemas by default.
60+
*/
61+
withSchema?: boolean;
5762
}
5863

5964
export interface RemoteDescriptor {

packages/server/src/providers/RemoteDescriptorProvider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ export class RemoteDescriptorProvider {
7474
serviceAccount: options.serviceAccount,
7575
proxy: !!options.proxy,
7676
internal: !proxy.noInternal,
77-
links: async ({ authorization, withSchema }) => {
77+
links: async (opts) => {
78+
const { authorization } = opts;
79+
const withSchema = options.withSchema ?? options.withSchema ?? false;
7880
const response = await this.fetchLinks({
7981
service: name,
8082
url: `${url}${linkPath}${withSchema ? "?withSchema=true" : ""}`,

0 commit comments

Comments
 (0)