dankinsoid / VaporToOpenAPI

OpenAPI specification generator for Vapor based Swift projects.
MIT License
98 stars 8 forks source link

Vapor 4.86.0 breaks VaporToOpenAPI build #16

Closed finestructure closed 9 months ago

finestructure commented 10 months ago

An upstream change in Vapor seems to have broken the build of VaporToOpenAPI:

/Users/sas/Library/Developer/Xcode/DerivedData/spi-server-gsbjdobzvfgnckdblpfcxbfdtnun/SourcePackages/checkouts/VaporToOpenAPI/Sources/VaporToOpenAPI/Route+UserInfo.swift:64:22 Type of expression is ambiguous without a type annotation
/Users/sas/Library/Developer/Xcode/DerivedData/spi-server-gsbjdobzvfgnckdblpfcxbfdtnun/SourcePackages/checkouts/VaporToOpenAPI/Sources/VaporToOpenAPI/Route+UserInfo.swift:64:22 Type of expression is ambiguous without a type annotation

CleanShot 2023-11-13 at 10 06 59@2x

It still works fine with the previous Vapor version of 4.85.1.

I'm not sure if this is a Vapor problem or Vapor exposing a VaporToOpenAPI problem but I thought I'd start by posting an issue here :)

finestructure commented 10 months ago

I'll try and figure out what's going on of course but I wanted to post this early in case it's immediately clear to someone else what's happening here.

0xTim commented 10 months ago

@finestructure this is an issue on Vapor's side - AnySendableHashable was supposed to be essentially backwards compatible with AnyHashable with a warning introduced if the value wasn't Sendable but it appears Swift does some magic with AnyHashable that we don't/can't. We had code that checks it but it looks like it depends on the usage for whether the compiler sees it as the same. I'm investigating whether we can do something to make it automatic or whether we need to add conformances for String etc manually and reduce the issue

finestructure commented 10 months ago

Ah, great to hear that you already have an idea what's happening. Thanks a lot, Tim!

dankinsoid commented 10 months ago

@0xTim should I do smth to fix it in my library or wait for Vapor fix?

0xTim commented 10 months ago

@dankinsoid it should be fixed by https://github.com/vapor/console-kit/releases/tag/4.10.2

@finestructure you can try that release. We'll have a Vapor release that pins to it soon

gwynne commented 10 months ago

vapor/vapor#3100 will provide the pin in question when merged, for the record.

finestructure commented 10 months ago

Thanks a lot @0xTim ! I've tested this here, it's all working again.