Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get all connectors to show up in oas spec #279

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions connectors/connector-yodlee/YodleeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ export const zCreds = z.discriminatedUnion('role', [

/** Yodlee comma-delimited ids */
type YodleeIds = z.input<typeof zYodleeIds>
export const zYodleeId = z
.union([z.number(), z.string()])
.transform((id) => (typeof id === 'string' ? Number.parseInt(id) : id))
.openapi({refType: 'input'}) // @see https://github.com/samchungy/zod-openapi#zod-effects
export const zYodleeId = z.union([z.number(), z.string()])
// cannot use transform for now because .openapi() does not work due to differing zod versions
// .transform((id) => (typeof id === 'string' ? Number.parseInt(id) : id))
// .openapi({refType: 'input'}) // @see https://github.com/samchungy/zod-openapi#zod-effects
// Ideally when converting we should default to always refType input... Or basically
// allow the zodToOas31Schema to control this instead.
const zYodleeIds = z.union([zYodleeId, z.array(zYodleeId)])
Expand Down Expand Up @@ -157,7 +157,16 @@ export const makeYodleeClient = zFunction([zConfig, zCreds], (cfg, creds) => {

const getProvider = zFunction(zYodleeId, async (providerId) =>
api
.GET('/providers/{providerId}', {params: {path: {providerId}}})
.GET('/providers/{providerId}', {
params: {
path: {
providerId:
typeof providerId === 'string'
? Number.parseInt(providerId)
: providerId,
},
},
})
.then((r) => {
if (!r.data?.provider?.[0]) {
throw new YodleeNotFoundError({
Expand Down
Loading