-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
OpenApiSchemaComparer uses code like hashCode.Add(obj.Properties.Count);
. In custom schema transforms where I might want to replace allof , anyof, or properties, intuitively I would set unwanted properties to null. Either the setter should prevent this, or the obj.Properties.Count
should be obj.Properties?.Count??0
or otherwise take care of nulls.
Expected Behavior
Not crash when a schema property is null.
Steps To Reproduce
Custom schema transform - set Properties to null. OpenApi doc gen and Scalar result have missing elements.
Exceptions (if any)
Object reference not set to an instance of an object.
.NET Version
9
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi