Skip to content

IsDeprecated() overwrites the previous value #470

@jo-ninja

Description

@jo-ninja

In SwaggerDefaultValues.cs sample code,

operation.Deprecated = apiDescription.IsDeprecated();

will overwrite and reset the deprecated flag already set to true by SwaggerGenerator because of the presence of Obsolete attribute in the user code (controller action).
I also wrote about this in a detailed blog post:
https://medium.com/@joni2nja/swashbuckle-and-api-versioning-obsolete-attribute-is-not-rendered-as-deprecated-in-swagger-ui-c44415111085

Is it possible to update the sample code to something like this?
operation.Deprecated |= apiDescription.IsDeprecated();

Any thoughts on this change?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions