Remove swagger definitions from sonar coverage

Viewed 105

When I push my code to sonar, it mentioned below type of codes not cover by unit tests(Jest JS). How to remove this kind of swagger definition code from code coverage in sonar.

@ApiOperationPost({
        description: "Student details",
        summary: "Student details",
        path: "/student",
        security: {
            authorization: [],
        },
        parameters: {},
        responses: {
            200: {
                description: "Student details request",
                model: "StudentDetailsRequest",
                type: SwaggerDefinitionConstant.Response.Type.ARRAY,
            },
            400: { description: "Expected Parameters Missing", model: "Problem" },
            401: { description: "Unauthorized", model: "Problem" },
            500: { description: "Internal Server Error", model: "Problem" },
        },
    })

Please help me to solve this issue. Any help or workarounds are really appreciated.

0 Answers
Related