You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenApiClientProvider cannot parse Immich spec - allOf data model with single item #279
Duplicate in method table is:
Type index: 8
Method name: .ctor
Method arity (num generic params): 0
Error: input.fsx (4,15)-(4,44) typecheck error The type provider 'SwaggerProvider.OpenApiClientTypeProvider' reported an error: Error in pass2 for type Immich, error: Error in pass2 for type ActivityCreateDto_Type, error: duplicate entry '.ctor' in method table
input.fsx (4,15)-(4,44)
Further investigation
If I edit the OpenAPI spec to remove the offending ActivityCreateDto (along with any paths and other DTOs that reference it) it then fails on ActivityResponseDto. Removing ActivityResponseDto causes it to fail on AddUsersDto and so on and so forth.
Where ActivityCreateDto complained about the "Type" property, others complained about the "Error", "Role", or "Order" properties. The common thread I have seen across them is that they all use the allOf data model referencing a single item.
Similar issues
Issue #263 also reports parse errors, though they are significantly different. There are two things suggested there:
That it is an issue with the spec. I have already reported this as in issue with Immich, but they believe that their spec is correct and it is the type provider that is incorrect.
Issues #135 and #184 also complain about constructors, but they are complaining about missing constructors, not duplicated ones. I could not find any issues referencing a duplicate constructor.
Issue #243 also complains of problems parsing allOf constraints, so this may well be related.
That it is an issue with the parser that will be fixed by #269 upgrading to the latest Microsoft.OpenApi version. I have tried using v3.0.0-beta01 but that did not address the issue.
Why do you think that upgrade to newer version of Microsoft.OpenApi parser will fix it? Changes from mentioned PR not included in beta version on NuGet.
We use inheritance and allOf from 2+ refs is problematic... allOf with just one ref is just strange 😐 but should be possible to support with not huge diff.
It is no longer complaining about the duplicate constructors, but it appears to set resolvedType to Some (Some Null) which then fails to match when setting tyType.
typecheck error The type provider 'SwaggerProvider.OpenApiClientTypeProvider' reported an error: Type AssetResponseDto_Stack(Null,) should be caught by other match statement (Some Null)
Activity
sergey-tihon commentedon Dec 22, 2025
Why do you think that upgrade to newer version of
Microsoft.OpenApiparser will fix it? Changes from mentioned PR not included in beta version on NuGet.We use inheritance and
allOffrom 2+ refs is problematic...allOfwith just onerefis just strange 😐 but should be possible to support with not huge diff.sergey-tihon commentedon Dec 24, 2025
please try https://www.nuget.org/packages/SwaggerProvider/3.0.0-beta03 it indeed may have a fix.
https://github.com/fsprojects/SwaggerProvider/blob/master/src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs#L391-L407
malacandrian commentedon Dec 30, 2025
Thank you.
It is no longer complaining about the duplicate constructors, but it appears to set
resolvedTypetoSome (Some Null)which then fails to match when settingtyType.