Skip to content

[F] typespecTypeToJson

function typespecTypeToJson<T>(typespecType, target): [T | undefined, Diagnostic[]];

Convert a TypeSpec type to a serializable Json object. Emits diagnostics if the given type is invalid

Type Parameter
T
ParameterTypeDescription
typespecTypeTypeSpecValueThe type to convert to Json data
targetDiagnosticTargetThe diagnostic target in case of errors.

[T | undefined, Diagnostic[]]