Skip to content

Merge master into openapi #1594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 14, 2024
Merged

Merge master into openapi #1594

merged 7 commits into from
Jul 14, 2024

Conversation

bkoelman
Copy link
Member

Merges the master branch into openapi, which fixes the handling of empty IDs.

dependabot bot and others added 7 commits July 12, 2024 15:25
| Method                  | Mean     | Error    | StdDev   | Ratio | Allocated | Alloc Ratio |
|------------------------ |---------:|---------:|---------:|------:|----------:|------------:|
| ActivatorCreateInstance | 84.13 ms | 4.029 ms | 1.046 ms |  1.00 |      69 B |        1.00 |
| LookupCached            | 67.93 ms | 0.345 ms | 0.053 ms |  0.81 |       7 B |        0.10 |

```c#
using System.Collections.Concurrent;
using BenchmarkDotNet.Attributes;

namespace Benchmarks;

// ReSharper disable once ClassCanBeSealed.Global
[MarkdownExporter]
[SimpleJob(1, 5, 5)]
[MemoryDiagnoser]
public class DefaultValueBenchmarks
{
    private const int IterationCount = 10_000_000;

    private static readonly ConcurrentDictionary<Type, object?> Cache = new()
    {
        [typeof(int?)] = null,
        [typeof(Guid?)] = null
    };

    [Benchmark(Baseline = true)]
    public void ActivatorCreateInstance()
    {
        for (int index = 0; index < IterationCount; index++)
        {
            _ = Activator.CreateInstance(typeof(int?));
            _ = Activator.CreateInstance(typeof(Guid?));
        }
    }

    [Benchmark]
    public void LookupCached()
    {
        for (int index = 0; index < IterationCount; index++)
        {
            _ = Cache.TryGetValue(typeof(int?), out _);
            _ = Cache.TryGetValue(typeof(Guid?), out _);
        }
    }
}
```
Fixed: Produce error on invalid ID in request body
@bkoelman bkoelman marked this pull request as ready for review July 14, 2024 11:23
Copy link

codecov bot commented Jul 14, 2024

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Project coverage is 91.42%. Comparing base (973883d) to head (ad59224).

Files Patch % Lines
...nApiDotNetCore/Resources/IdentifiableExtensions.cs 25.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           openapi    #1594      +/-   ##
===========================================
+ Coverage    91.39%   91.42%   +0.03%     
===========================================
  Files          412      412              
  Lines        13438    13442       +4     
  Branches      2100     2102       +2     
===========================================
+ Hits         12281    12290       +9     
+ Misses         751      747       -4     
+ Partials       406      405       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bkoelman bkoelman merged commit 92e5590 into openapi Jul 14, 2024
16 checks passed
@bkoelman bkoelman deleted the merge-master-into-openapi branch July 14, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant