Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

AdvertiseApiVersionsAttribute causes stackoverflow when enumarated #932

Copy link
Copy link
Closed
@marius-w-nilsen

Description

@marius-w-nilsen
Issue body actions

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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.