History

fix patch release data upgrades (#405)

Rhys Sullivan committed 6 months ago

Commit 1492de31 parent 28ea43c6 files · +166 −16Browse files

Showing the changes to packages/plugins/openapi/src (1 of 6 files). Show all

Unified · Split

packages/plugins/openapi/src/sdk/plugin.ts+12−4
@@ -795,8 +795,8 @@ export const openApiPlugin = definePlugin( · 794 unmodified lines
795 name: existing.name,795 name: existing.name,
796 baseUrl: resolvedConfig.baseUrl,796 baseUrl: resolvedConfig.baseUrl,
797 namespace: existing.namespace,797 namespace: existing.namespace,
798 headers: existing.config.headers,798 headers: existing.legacy?.headers ?? existing.config.headers,
799 oauth2: existing.config.oauth2,799 oauth2: existing.legacy?.oauth2 ?? existing.config.oauth2,
800 });800 });
801 });801 });
802 802
@@ -872,9 +872,17 @@ export const openApiPlugin = definePlugin( · 69 unmodified lines
872 const existing = yield* ctx.storage.getSource(namespace, scope);872 const existing = yield* ctx.storage.getSource(namespace, scope);
873 if (!existing) return;873 if (!existing) return;
874 const canonicalHeaders =874 const canonicalHeaders =
875 input.headers !== undefined ? canonicalizeHeaders(input.headers) : null;875 input.headers !== undefined
876 ? canonicalizeHeaders(input.headers)
877 : existing.legacy?.headers
878 ? canonicalizeHeaders(existing.legacy.headers)
879 : null;
876 const canonicalOAuth2 =880 const canonicalOAuth2 =
877 input.oauth2 !== undefined ? canonicalizeOAuth2(input.oauth2) : null;881 input.oauth2 !== undefined
882 ? canonicalizeOAuth2(input.oauth2)
883 : existing.legacy?.oauth2
884 ? canonicalizeOAuth2(existing.legacy.oauth2)
885 : null;
878 yield* ctx.storage.updateSourceMeta(namespace, scope, {886 yield* ctx.storage.updateSourceMeta(namespace, scope, {
879 name: input.name?.trim() || undefined,887 name: input.name?.trim() || undefined,
880 baseUrl: input.baseUrl,888 baseUrl: input.baseUrl,