From 6a259ae65aecab94d3c033fff6ade02d3be24227 Mon Sep 17 00:00:00 2001 From: PARAIPAN SORIN <51127880+PARAIPAN9@users.noreply.github.com> Date: Wed, 20 Sep 2023 00:44:26 +0300 Subject: [PATCH] Fixes #78 - Explicitly name reusable header types as 'response header' types (#284) --- .../Translator/Responses/TypedResponseHeader.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/_OpenAPIGeneratorCore/Translator/Responses/TypedResponseHeader.swift b/Sources/_OpenAPIGeneratorCore/Translator/Responses/TypedResponseHeader.swift index 78cae1bc..38023141 100644 --- a/Sources/_OpenAPIGeneratorCore/Translator/Responses/TypedResponseHeader.swift +++ b/Sources/_OpenAPIGeneratorCore/Translator/Responses/TypedResponseHeader.swift @@ -86,19 +86,19 @@ extension FileTranslator { /// Returns a typed response header for the provided unresolved header. /// - Parameters: - /// - unresolvedHeader: The header specified in the OpenAPI document. + /// - unresolvedResponseHeader: The header specified in the OpenAPI document. /// - name: The name of the header. /// - parent: The Swift type name of the parent type of the headers. /// - Returns: Typed response header if supported, nil otherwise. func typedResponseHeader( - from unresolvedHeader: UnresolvedHeader, + from unresolvedResponseHeader: UnresolvedResponseHeader, named name: String, inParent parent: TypeName ) throws -> TypedResponseHeader? { // Collect the header let header: OpenAPI.Header - switch unresolvedHeader { + switch unresolvedResponseHeader { case let .a(ref): header = try components.lookup(ref) case let .b(_header): @@ -143,7 +143,7 @@ extension FileTranslator { } let type: TypeUsage - switch unresolvedHeader { + switch unresolvedResponseHeader { case let .a(ref): type = try typeAssigner.typeName(for: ref).asUsage case .b: @@ -173,4 +173,4 @@ extension FileTranslator { /// An unresolved OpenAPI response header. /// /// Can be either a reference or an inline response header. -typealias UnresolvedHeader = Either, OpenAPI.Header> +typealias UnresolvedResponseHeader = Either, OpenAPI.Header>