Showing the changes to packages/plugins/openapi/src (1 of 6 files). Show all
Unified · Split
| @@ -795,8 +795,8 @@ export const openApiPlugin = definePlugin( · 794 unmodified lines | ||
| 795 | 795 | name: existing.name, |
| 796 | 796 | baseUrl: resolvedConfig.baseUrl, |
| 797 | 797 | namespace: existing.namespace, |
| 798 | − headers: existing.config.headers, | |
| 799 | − oauth2: existing.config.oauth2, | |
| 798 | + headers: existing.legacy?.headers ?? existing.config.headers, | |
| 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 | 872 | const existing = yield* ctx.storage.getSource(namespace, scope); |
| 873 | 873 | if (!existing) return; |
| 874 | 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 | 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 | 886 | yield* ctx.storage.updateSourceMeta(namespace, scope, { |
| 879 | 887 | name: input.name?.trim() || undefined, |
| 880 | 888 | baseUrl: input.baseUrl, |