Hi Ayush
This is an error that happens when the symbol graph contains a relationship where the source symbol doesn’t exist in the symbol graph.
For example, let's say we have two symbols, Color
and Yellow
, there is a relationship between them defined as follows:
{
"kind" : "memberOf",
"source" : "yellow",
"target" : "color",
"targetFallback" : null
}
With the respective symbol definitions:
{
"kind": {
"identifier": "swift.type.property",
"displayName": "Type Property"
},
"identifier": {
"precise": "color",
"interfaceLanguage": "swift"
},
"pathComponents": [
"light",
],
"names": {
"title": "color"
},
"navigator" : [...],
"declarationFragments": [...],
"accessLevel": "public",
}
{
"kind": {
"identifier": "swift.type.property",
"displayName": "Type Property"
},
"identifier": {
"precise": "yellow",
"interfaceLanguage": "swift"
},
"pathComponents": [
"light (foo)",
"color",
],
"names": {
"title": "yellow"
},
"declarationFragments": [...],
"accessLevel": "public",
}
Notice how the path component of the child symbol contains a symbol that does not exist. This is caused by an error in the symbol graph generation process.
when converting OpenAPI endpoints and schemas to SymbolGraph symbols, what specific fields and structure does DocC require?
The SymbolGraph follows the definition provided by SymbolKit. Your tool can use this as a dependency to generate valid symbols and valid symbol graph structures. By looking at the source code, we can infer the required attributes for a symbol. (swift-docc-symbolkit/Sources/SymbolKit/SymbolGraph/Symbol/Symbol.swift at main · swiftlang/swift-docc-symbolkit · GitHub).
You also might find interesting to see that there is already some support for http symbols in the codebase (swift-docc-symbolkit/Sources/SymbolKit/SymbolGraph/Symbol/HTTP/HTTP.swift at main · swiftlang/swift-docc-symbolkit · GitHub), just highlighting this as it might be useful for your tool.