@@ -229,14 +229,8 @@ public struct DocumentationNode {
229
229
?? . init( availability: [ ] )
230
230
}
231
231
232
- let endpointVariants = DocumentationDataVariants (
233
- symbolData: unifiedSymbol. mixins,
234
- platformName: platformName
235
- ) { mixins -> HTTPEndpointSection ? in
236
- if let endpoint = mixins [ SymbolGraph . Symbol. HTTP. Endpoint. mixinKey] as? SymbolGraph . Symbol . HTTP . Endpoint {
237
- return HTTPEndpointSection ( endpoint: endpoint)
238
- }
239
- return nil
232
+ let endpointSection = unifiedSymbol. defaultSymbol ? [ mixin: SymbolGraph . Symbol. HTTP. Endpoint. self] . map { endpoint in
233
+ HTTPEndpointSection ( endpoint: endpoint)
240
234
}
241
235
242
236
let overloadVariants = DocumentationDataVariants (
@@ -314,13 +308,13 @@ public struct DocumentationNode {
314
308
seeAlsoVariants: . empty,
315
309
returnsSectionVariants: . empty,
316
310
parametersSectionVariants: . empty,
317
- dictionaryKeysSectionVariants : . empty ,
318
- possibleValuesSectionVariants : . empty ,
319
- httpEndpointSectionVariants : endpointVariants ,
320
- httpBodySectionVariants : . empty ,
321
- httpParametersSectionVariants : . empty ,
322
- httpResponsesSectionVariants : . empty ,
323
- redirectsVariants : . empty ,
311
+ dictionaryKeysSection : nil ,
312
+ possibleValuesSection : nil ,
313
+ httpEndpointSection : endpointSection ,
314
+ httpBodySection : nil ,
315
+ httpParametersSection : nil ,
316
+ httpResponsesSection : nil ,
317
+ redirects : nil ,
324
318
crossImportOverlayModule: moduleData. bystanders. map ( { ( moduleData. name, $0) } ) ,
325
319
overloadsVariants: overloadVariants
326
320
)
@@ -399,9 +393,7 @@ public struct DocumentationNode {
399
393
semantic. deprecatedSummaryVariants = DocumentationDataVariants (
400
394
defaultVariantValue: deprecated
401
395
)
402
- semantic. redirectsVariants = DocumentationDataVariants (
403
- defaultVariantValue: documentationExtension? . redirects
404
- )
396
+ semantic. redirects = documentationExtension? . redirects
405
397
406
398
let filter = ParametersAndReturnValidator ( diagnosticEngine: engine, docChunkSources: docChunks. map ( \. source) )
407
399
let ( parametersSectionVariants, returnsSectionVariants) = filter. makeParametersAndReturnsSections (
@@ -415,22 +407,22 @@ public struct DocumentationNode {
415
407
416
408
if let keys = markupModel. discussionTags? . dictionaryKeys, !keys. isEmpty {
417
409
// Record the keys extracted from the markdown
418
- semantic. dictionaryKeysSectionVariants [ . fallback ] = DictionaryKeysSection ( dictionaryKeys: keys)
410
+ semantic. dictionaryKeysSection = DictionaryKeysSection ( dictionaryKeys: keys)
419
411
}
420
412
421
413
if let parameters = markupModel. discussionTags? . httpParameters, !parameters. isEmpty {
422
414
// Record the parameters extracted from the markdown
423
- semantic. httpParametersSectionVariants [ . fallback ] = HTTPParametersSection ( parameters: parameters)
415
+ semantic. httpParametersSection = HTTPParametersSection ( parameters: parameters)
424
416
}
425
417
426
418
if let body = markupModel. discussionTags? . httpBody {
427
419
// Record the body extracted from the markdown
428
- semantic. httpBodySectionVariants [ . fallback ] = HTTPBodySection ( body: body)
420
+ semantic. httpBodySection = HTTPBodySection ( body: body)
429
421
}
430
422
431
423
if let responses = markupModel. discussionTags? . httpResponses, !responses. isEmpty {
432
424
// Record the responses extracted from the markdown
433
- semantic. httpResponsesSectionVariants [ . fallback ] = HTTPResponsesSection ( responses: responses)
425
+ semantic. httpResponsesSection = HTTPResponsesSection ( responses: responses)
434
426
}
435
427
436
428
// The property list symbol's allowed values.
@@ -467,10 +459,10 @@ public struct DocumentationNode {
467
459
}
468
460
469
461
// Record the possible values extracted from the markdown.
470
- semantic. possibleValuesSectionVariants [ . fallback ] = PropertyListPossibleValuesSection ( possibleValues: knownPossibleValues)
462
+ semantic. possibleValuesSection = PropertyListPossibleValuesSection ( possibleValues: knownPossibleValues)
471
463
} else if let symbolAllowedValues {
472
464
// Record the symbol possible values even if none are documented.
473
- semantic. possibleValuesSectionVariants [ . fallback ] = PropertyListPossibleValuesSection ( possibleValues: symbolAllowedValues. value. map {
465
+ semantic. possibleValuesSection = PropertyListPossibleValuesSection ( possibleValues: symbolAllowedValues. value. map {
474
466
PropertyListPossibleValuesSection . PossibleValue ( value: String ( $0) , contents: [ ] )
475
467
} )
476
468
}
@@ -778,13 +770,13 @@ public struct DocumentationNode {
778
770
seeAlsoVariants: . init( swiftVariant: markupModel. seeAlsoSection) ,
779
771
returnsSectionVariants: . init( swiftVariant: markupModel. discussionTags. flatMap ( { $0. returns. isEmpty ? nil : ReturnsSection ( content: $0. returns [ 0 ] . contents) } ) ) ,
780
772
parametersSectionVariants: . init( swiftVariant: markupModel. discussionTags. flatMap ( { $0. parameters. isEmpty ? nil : ParametersSection ( parameters: $0. parameters) } ) ) ,
781
- dictionaryKeysSectionVariants : . init ( swiftVariant : markupModel. discussionTags. flatMap ( { $0. dictionaryKeys. isEmpty ? nil : DictionaryKeysSection ( dictionaryKeys: $0. dictionaryKeys) } ) ) ,
782
- possibleValuesSectionVariants : . init ( swiftVariant : markupModel. discussionTags. flatMap ( { $0. possiblePropertyListValues. isEmpty ? nil : PropertyListPossibleValuesSection ( possibleValues: $0. possiblePropertyListValues) } ) ) ,
783
- httpEndpointSectionVariants : . empty ,
784
- httpBodySectionVariants : . empty ,
785
- httpParametersSectionVariants : . empty ,
786
- httpResponsesSectionVariants : . empty ,
787
- redirectsVariants : . init ( swiftVariant : article? . redirects)
773
+ dictionaryKeysSection : markupModel. discussionTags. flatMap ( { $0. dictionaryKeys. isEmpty ? nil : DictionaryKeysSection ( dictionaryKeys: $0. dictionaryKeys) } ) ,
774
+ possibleValuesSection : markupModel. discussionTags. flatMap ( { $0. possiblePropertyListValues. isEmpty ? nil : PropertyListPossibleValuesSection ( possibleValues: $0. possiblePropertyListValues) } ) ,
775
+ httpEndpointSection : nil ,
776
+ httpBodySection : nil ,
777
+ httpParametersSection : nil ,
778
+ httpResponsesSection : nil ,
779
+ redirects : article? . redirects
788
780
)
789
781
790
782
self . isVirtual = symbol. isVirtual
0 commit comments