perf(schema): optimize boolean schema deserialization · microsoft/OpenAPI.NET@fe6f513 · GitHub
Skip to content

Commit fe6f513

Browse files
baywetCopilot
andcommitted
perf(schema): optimize boolean schema deserialization
Add generic GetValue<T>() method to ValueNode to allow direct type access without string conversion. Update V31 and V32 schema deserializers to use GetValue<bool>() directly instead of converting to string and parsing with bool.TryParse(). This eliminates unnecessary string allocations and conversions for boolean schema values, improving performance in the deserialization hot path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 7316e3f)
1 parent 43377ee commit fe6f513

2 files changed

Lines changed: 18 additions & 11 deletions

File tree

src/Microsoft.OpenApi/Reader/ParseNodes/ValueNode.cs

Lines changed: 11 additions & 0 deletions

src/Microsoft.OpenApi/Reader/V31/OpenApiSchemaDeserializer.cs

Lines changed: 7 additions & 11 deletions

0 commit comments

Comments
 (0)