You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[RLC Emitter] - RangeError: Maximum call stack size exceeded #2290 Reason: When getEffectiveModelFromType tries to handle the models that extend Error, getEffectiveModelType resolves to Error eventually causing an infinite loop. Potential Fix: Not sure what the actual fix would be here, locally I hacked it to special case when getEffectiveModelType resolves to Error and return the type instead. This needs more investigation
[RLC Emitter] - extractNameFromTypeSpecType doesn't handle anonymous models correctly. #2291 Reason - extractNameFromTypeSpecType blindly appends ResourceMergeAndPatch to the model name. However, there are cases when instead of the model name, we have the actual anonymous model definition inline, which causes an invalid output such as body?: {"patch": TodoItemPatch;}ResourceMergeAndPatch;
Potential Fix - in extractNameFromTypeSpecType check if the model is anonymous before appending the suffix to it
@qiaozha@MaryGao this commit contains the fixes I tried and mentioned above. Please feel free to take as much as you want from the commit or propose different approaches
TypeSpec: https://github.com/bterlson/typespec-todo/blob/main/main.tsp
I ran this through the generator and found the following issues:
[TCGC] - TCGC Should not refuse unknown format, but pass it through to emitters instead typespec-azure#272
[RLC Emitter] - TypeError: Cannot read properties of undefined (reading 'type') #2289
Reason:
getSchemaForType
doesn't know how to handle ModelProperty by itself, just if it comes within a Model.Potential Fix - The fix I tried is to check for ModelProperty and recursively call
getSchemaForType
on its type.[RLC Emitter] - RangeError: Maximum call stack size exceeded #2290
Reason: When
getEffectiveModelFromType
tries to handle the models that extend Error,getEffectiveModelType
resolves to Error eventually causing an infinite loop.Potential Fix: Not sure what the actual fix would be here, locally I hacked it to special case when
getEffectiveModelType
resolves to Error and return the type instead. This needs more investigation[RLC Emitter] -
extractNameFromTypeSpecType
doesn't handle anonymous models correctly. #2291Reason -
extractNameFromTypeSpecType
blindly appendsResourceMergeAndPatch
to the model name. However, there are cases when instead of the model name, we have the actual anonymous model definition inline, which causes an invalid output such asbody?: {"patch": TodoItemPatch;}ResourceMergeAndPatch;
Potential Fix - in
extractNameFromTypeSpecType
check if the model is anonymous before appending the suffix to itAdditional investigation:
We have to check how the @error tag is been processed if at all, it looks like RLC didn't generate
isUnexpected
which is unexpected (:smile:). And the errors seem to be getting generated as expected responses. #2292Binary data for MFD is being generated as
string
I think we need to generateUInt8Array
at least. #2293The text was updated successfully, but these errors were encountered: