Skip to content

Conversation

@tatsumack
Copy link
Contributor

This PR removes a redundant condition check in the ValidateResponse function.

Currently, there are two checks for options.ExcludeResponseBody:

// First check at line 91
if options.ExcludeResponseBody {
    // A user turned off validation of a response's body.
    return nil
}

// Second check at line 97 (redundant)
if len(content) == 0 || options.ExcludeResponseBody {
    // An operation does not contains a validation schema for responses with this status code.
    return nil
}

The second check is redundant because if options.ExcludeResponseBody is true, the function would have already returned at the first check. This PR removes the redundant condition to improve code clarity.

@fenollp fenollp merged commit e3d68dc into getkin:master Mar 10, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants