Skip to main content
Version: Next 🚧

[F] addEncodeInfo

function addEncodeInfo(
context,
type,
propertyType,
defaultContentType?): [void, readonly Diagnostic[]]

Add encoding info onto an sdk type. Since the encoding decorator decorates the ModelProperty, we add the encoding info onto the property's internal type.

Parameters​

ParameterTypeDescription
contextTCGCContextsdk context
typeModelProperty | Scalarthe original typespec type. Used to grab the encoding decorator off of
propertyTypeSdkTypethe type of the property, i.e. the internal type that we add the encoding info onto
defaultContentType?string-

Returns​

[void, readonly Diagnostic[]]