Skip to content

Commit 96ca90b

Browse files
committed
fix: xml case to be consistent
1 parent 8c66177 commit 96ca90b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Sources/_OpenAPIGeneratorCore/Translator/Content/ContentInspector.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ extension FileTranslator {
130130
let mapWithContentTypes = try map.map { key, content in try (type: key.asGeneratorContentType, value: content) }
131131

132132
let chosenContent: (type: ContentType, schema: SchemaContent, content: OpenAPI.Content)?
133-
if let (contentType, contentValue) = mapWithContentTypes.first(where: { $0.type.isJSON || $0.type.isXml }) {
133+
if let (contentType, contentValue) = mapWithContentTypes.first(where: { $0.type.isJSON || $0.type.isXML }) {
134134
chosenContent = (contentType, .init(contentType: contentType, schema: contentValue.schema), contentValue)
135135
} else if !excludeBinary,
136136
let (contentType, contentValue) = mapWithContentTypes.first(where: { $0.type.isBinary })
@@ -192,7 +192,7 @@ extension FileTranslator {
192192
)
193193
}
194194
if contentType.isJSON { return .init(contentType: contentType, schema: contentValue.schema) }
195-
if contentType.isXml { return .init(contentType: contentType, schema: contentValue.schema) }
195+
if contentType.isXML { return .init(contentType: contentType, schema: contentValue.schema) }
196196
if contentType.isUrlEncodedForm { return .init(contentType: contentType, schema: contentValue.schema) }
197197
if contentType.isMultipart {
198198
guard isRequired else {

Sources/_OpenAPIGeneratorCore/Translator/Content/ContentType.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,10 @@ struct ContentType: Hashable {
224224
/// A Boolean value that indicates whether the content type
225225
/// is a multipart form.
226226
var isMultipart: Bool { category == .multipart }
227+
227228
/// A Boolean value that indicates whether the content type
228229
/// is a type of XML.
229-
var isXml: Bool { category == .xml }
230+
var isXML: Bool { category == .xml }
230231

231232
/// The content type `text/plain`.
232233
static var textPlain: Self { try! .init(string: "text/plain") }

0 commit comments

Comments
 (0)