Skip to content

[Bug]: Breaking: Writes default values for exclusiveMaximum/exclusiveMinimum to openapi.json #2959

@bkoelman

Description

@bkoelman

Describe the bug

@jgarciadelanoceda Thanks for implementing #2958! I gave it a try today on our codebase using the MyGet feed.

Unfortunately, I'm getting test failures on openapi.json files that don't use [Range]. This is because exclusiveMinimum and exclusiveMaximum are being written even when set to false, or not set at all. In those cases, they should be omitted from the output openapi.json, because the default is already false in OpenAPI (and also in .NET).

Expected behavior

No "exclusiveMaximum": false, "exclusiveMinimum": false when not using [Range] or the Exclusive* properties on [Range] are set to false.

Actual behavior

The fragment "exclusiveMaximum": false, "exclusiveMinimum": false is written to output openapi.json, causing our assertions on the file contents to fail.

Steps to reproduce

No response

Exception(s) (if any)

No response

Swashbuckle.AspNetCore version

latest master (2db53de)

.NET Version

.NET 8

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions