Skip to content
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
13 changes: 12 additions & 1 deletion src/SwaggerProvider.DesignTime/Provider.OpenApiClient.fs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,19 @@ type public OpenApiClientTypeProvider(cfg: TypeProviderConfig) as this =
let preferAsync = unbox<bool> args.[4]
let ssrfProtection = unbox<bool> args.[5]

// Cache key includes cfg.RuntimeAssembly, cfg.ResolutionFolder, and cfg.SystemRuntimeAssemblyVersion
// to differentiate between different TFM builds (same approach as FSharp.Data)
// See: https://github.com/fsprojects/FSharp.Data/blob/main/src/FSharp.Data.DesignTime/CommonProviderImplementation/Helpers.fs
let cacheKey =
(schemaPathRaw, ignoreOperationId, ignoreControllerPrefix, preferNullable, preferAsync, ssrfProtection)
(schemaPathRaw,
ignoreOperationId,
ignoreControllerPrefix,
preferNullable,
preferAsync,
ssrfProtection,
cfg.RuntimeAssembly,
cfg.ResolutionFolder,
cfg.SystemRuntimeAssemblyVersion)
|> sprintf "%A"

let addCache() =
Expand Down
14 changes: 13 additions & 1 deletion src/SwaggerProvider.DesignTime/Provider.SwaggerClient.fs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,20 @@ type public SwaggerTypeProvider(cfg: TypeProviderConfig) as this =
let preferAsync = unbox<bool> args.[5]
let ssrfProtection = unbox<bool> args.[6]

// Cache key includes cfg.RuntimeAssembly, cfg.ResolutionFolder, and cfg.SystemRuntimeAssemblyVersion
// to differentiate between different TFM builds (same approach as FSharp.Data)
// See: https://github.com/fsprojects/FSharp.Data/blob/main/src/FSharp.Data.DesignTime/CommonProviderImplementation/Helpers.fs
let cacheKey =
(schemaPathRaw, headersStr, ignoreOperationId, ignoreControllerPrefix, preferNullable, preferAsync, ssrfProtection)
(schemaPathRaw,
headersStr,
ignoreOperationId,
ignoreControllerPrefix,
preferNullable,
preferAsync,
ssrfProtection,
cfg.RuntimeAssembly,
cfg.ResolutionFolder,
cfg.SystemRuntimeAssemblyVersion)
|> sprintf "%A"

let addCache() =
Expand Down
Loading