Skip to content

AdvertiseApiVersionsAttribute causes stackoverflow when enumarated #932

Closed
@marius-w-nilsen

Description

@marius-w-nilsen

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Adding [AdvertiseApiVersions] attribute to either Controller or Method causes stack overflow exception when enumarted.

Because AdvertiseApiVersionsAttribute.GetHashCode() doesn't call base.GetHashCode() it causes a stackoverflow when enumerated. I.e when Swagger generates docs (Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateResponse)

AdvertiseApiVersionsAttribute

Expected Behavior

Adding [AdvertiseApiVersions] does not cause stack overflow when enumerated.

Steps To Reproduce

Add [AdvertiseApiVersions(3.0)] attribute to a controller V2/Controllers/OrdersController.cs in your example (AspNetCore/OpenApiExample)

Exceptions (if any)

If I completely misunderstand the reason for [AdvertiseApiVersions]

.NET Version

7.0.100

Anything else?

I was unable to get the FormatProviderTest to run locally, otherwise this would've been a PR 😢

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions