Avatar
Kishikawa Katsumi 11/15/2020 11:31 PM
CodableだけどVaporのContentにConformsできないっていうの https://github.com/kishikawakatsumi/CodableConformsToContent/blob/master/Sources/App/routes.swift#L15 これです。 DocumentSymbolRequest.ResponseCodable なんですけど Conditional conformance of type 'Optional<Wrapped>' to protocol 'Content' does not imply conformance to inherited protocol 'RequestDecodable' というエラーで、 定義は public struct DocumentSymbolRequest: TextDocumentRequest, Hashable { public static let method: String = "textDocument/documentSymbol" public typealias Response = DocumentSymbolResponse? /// The document in which to lookup the symbol location. public var textDocument: TextDocumentIdentifier public init(textDocument: TextDocumentIdentifier) { self.textDocument = textDocument } } なので typealias Response = DocumentSymbolResponse? のところが問題なのかな? ちなみに、 DocumentSymbolResponse の方は extension DocumentSymbolResponse: Content {} でOK。 (edited)
Contribute to kishikawakatsumi/CodableConformsToContent development by creating an account on GitHub.