Skip to content

Commit ad75749

Browse files
authored
Audit for the word "content" incorrectly used to refer to body in public API (#256)
### Motivation Fixes #14. ### Modifications Only found one incorrect use of the term "content" that refers to the body, and fixed it. Found no occurrences in the public API. ### Result No more terminology confusion between "content" and "body". ### Test Plan N/A, no behavior change, just renaming variables.
1 parent 0aa6774 commit ad75749

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Sources/_OpenAPIGeneratorCore/Translator/Responses/translateResponse.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ extension TypesFileTranslator {
7777
inParent: bodyTypeName
7878
)
7979

80-
let contentProperty: PropertyBlueprint?
80+
let bodyProperty: PropertyBlueprint?
8181
if !typedContents.isEmpty {
8282
var bodyCases: [Declaration] = []
8383
for typedContent in typedContents {
@@ -117,7 +117,7 @@ extension TypesFileTranslator {
117117
)
118118

119119
let contentTypeUsage = bodyTypeName.asUsage.withOptional(hasNoContent)
120-
contentProperty = PropertyBlueprint(
120+
bodyProperty = PropertyBlueprint(
121121
comment: .doc("Received HTTP response body"),
122122
originalName: Constants.Operation.Body.variableName,
123123
typeUsage: contentTypeUsage,
@@ -128,7 +128,7 @@ extension TypesFileTranslator {
128128
asSwiftSafeName: swiftSafeName
129129
)
130130
} else {
131-
contentProperty = nil
131+
bodyProperty = nil
132132
}
133133

134134
let responseStructDecl = translateStructBlueprint(
@@ -139,7 +139,7 @@ extension TypesFileTranslator {
139139
conformances: Constants.Operation.Output.Payload.conformances,
140140
properties: [
141141
headersProperty,
142-
contentProperty,
142+
bodyProperty,
143143
]
144144
.compactMap { $0 }
145145
)

scripts/check-license-headers.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ read -ra PATHS_TO_CHECK_FOR_LICENSE <<< "$( \
5454
":(exclude)SECURITY.md" \
5555
":(exclude)scripts/unacceptable-language.txt" \
5656
":(exclude)Tests/PetstoreConsumerTests/Generated" \
57-
":(exclude)Tests/PetstoreConsumerTestsFFMultipleContentTypes/Generated" \
5857
":(exclude)Tests/OpenAPIGeneratorReferenceTests/Resources/ReferenceSources/*" \
5958
":(exclude)docker/*" \
6059
":(exclude)**/*.docc/*" \

0 commit comments

Comments
 (0)