Skip to content

[Bug]: Different swagger.json on Linux und Windows #3326

@stefannikolei

Description

@stefannikolei

Describe the bug

Between 7.3.1 and 7.3.2 probably by #3295 the generation of the swagger.json has changed.

We have a test that checks if something has changed in the swagger document. (We had problems that it could not get generated so this was the easiest way to ensure it ;) )

The test is really simple:

 [Fact]
    public async Task SwaggerJsonTestAsync()
    {
        var response = await Client.GetAsync("swagger/v1/swagger.json", TestContext.Current.CancellationToken);
        response.StatusCode.ShouldBe(HttpStatusCode.OK);

        await Verify(await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken));
    }

In the background the TestServer is used.

Now to my problem.

We now get errors from Verify when the test is run in an Linux environment. We expect to have \r\n in the json and not \n

For example:

Image

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Exception(s) (if any)

No response

Swashbuckle.AspNetCore version

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstaleStale issues or pull requests

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions