History

Fix OpenAPI OAuth config compatibility (#848)

Rhys Sullivan committed 5 months ago

Commit 85e677d1 parent 0fd4d114 files · +78 −3Browse files

Showing the changes to packages/plugins/http-source/src (1 of 4 files). Show all

Unified · Split

packages/plugins/http-source/src/sdk/types.ts+5−2
@@ -1,4 +1,4 @@
1−import { Schema } from "effect";
1+import { Effect, Schema } from "effect";
22
33 export const HttpCredentialInput = Schema.Union([
44 Schema.String,
@@ -37,7 +37,10 @@ export const OAuth2SourceConfig = Schema.Struct({ · 32 unmodified lines
3737 securitySchemeName: Schema.String,
3838 flow: OAuth2Flow,
3939 tokenUrl: Schema.String,
40− authorizationUrl: Schema.NullOr(Schema.String),
40+ authorizationUrl: Schema.NullOr(Schema.String).pipe(
41+ Schema.optional,
42+ Schema.withDecodingDefault(Effect.succeed(null)),
43+ ),
4144 issuerUrl: Schema.optional(Schema.NullOr(Schema.String)),
4245 clientIdSlot: Schema.String,
4346 clientSecretSlot: Schema.NullOr(Schema.String),