Skip to content

Commit

Permalink
fix code for recursive messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vandonr committed Dec 19, 2024
1 parent 6048926 commit daf650f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ private ulong ExtractSchema(IMessageDescriptorProxy descriptor, int depth = 0)

if (!_schemas.ContainsKey(descriptor.Name))
{
_schemas.Add(descriptor.Name, new OpenApiSchema { Type = "object", Properties = ExtractFields(descriptor, depth) });
var schema = new OpenApiSchema { Type = "object" };
_schemas.Add(descriptor.Name, schema);
// It's important that we extract the fields AFTER adding the key to the dict, to make sure we don't re-extract on recursive message types
schema.Properties = ExtractFields(descriptor, depth);
}

return _computedHash;
Expand Down

0 comments on commit daf650f

Please sign in to comment.