// Path: src/main/java/com/github/mkopylec/errorest/configuration/ErrorestProperties.java
// @ConfigurationProperties("errorest")
// public class ErrorestProperties {
// 
//     /**
//      * HTTP response body format.
//      */
//     private ResponseBodyFormat responseBodyFormat = FULL;
//     /**
//      * Properties responsible for handling validation errors.
//      */
//     private BeanValidationError beanValidationError = new BeanValidationError();
//     /**
//      * Properties responsible for handling 4xx HTTP errors.
//      */
//     private HttpClientError httpClientError = new HttpClientError();
// 
//     public ResponseBodyFormat getResponseBodyFormat() {
//         return responseBodyFormat;
//     }
// 
//     public void setResponseBodyFormat(ResponseBodyFormat responseBodyFormat) {
//         this.responseBodyFormat = responseBodyFormat;
//     }
// 
//     public BeanValidationError getBeanValidationError() {
//         return beanValidationError;
//     }
// 
//     public void setBeanValidationError(BeanValidationError beanValidationError) {
//         this.beanValidationError = beanValidationError;
//     }
// 
//     public HttpClientError getHttpClientError() {
//         return httpClientError;
//     }
// 
//     public void setHttpClientError(HttpClientError httpClientError) {
//         this.httpClientError = httpClientError;
//     }
// 
//     public enum ResponseBodyFormat {
//         WITHOUT_DESCRIPTIONS, FULL
//     }
// 
//     public static class BeanValidationError {
// 
//         /**
//          * Validation errors logging level.
//          */
//         private LoggingLevel loggingLevel = WARN;
// 
//         public LoggingLevel getLoggingLevel() {
//             return loggingLevel;
//         }
// 
//         public void setLoggingLevel(LoggingLevel loggingLevel) {
//             this.loggingLevel = loggingLevel;
//         }
//     }
// 
//     public static class HttpClientError {
// 
//         /**
//          * HTTP 4xx errors logging level.
//          */
//         private LoggingLevel loggingLevel = WARN;
// 
//         public LoggingLevel getLoggingLevel() {
//             return loggingLevel;
//         }
// 
//         public void setLoggingLevel(LoggingLevel loggingLevel) {
//             this.loggingLevel = loggingLevel;
//         }
//     }
// }
// 
// Path: src/main/java/com/github/mkopylec/errorest/handling/errordata/ErrorData.java
// public class ErrorData {
// 
//     public static final int ERRORS_ID_LENGTH = 10;
// 
//     protected final String id;
//     protected final LoggingLevel loggingLevel;
//     protected final String requestMethod;
//     protected final String requestUri;
//     protected final HttpStatus responseStatus;
//     protected final List<Error> errors;
//     protected final Throwable throwable;
// 
//     protected ErrorData(String id, LoggingLevel loggingLevel, String requestMethod, String requestUri, HttpStatus responseStatus, List<Error> errors, Throwable throwable) {
//         this.id = id;
//         this.loggingLevel = loggingLevel;
//         this.requestMethod = requestMethod;
//         this.requestUri = requestUri;
//         this.responseStatus = responseStatus;
//         this.errors = errors;
//         this.throwable = throwable;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public LoggingLevel getLoggingLevel() {
//         return loggingLevel;
//     }
// 
//     public boolean hasLoggingLevel(LoggingLevel level) {
//         return loggingLevel == level;
//     }
// 
//     public String getRequestMethod() {
//         return requestMethod;
//     }
// 
//     public String getRequestUri() {
//         return requestUri;
//     }
// 
//     public HttpStatus getResponseStatus() {
//         return responseStatus;
//     }
// 
//     public List<Error> getErrors() {
//         return errors;
//     }
// 
//     public Throwable getThrowable() {
//         return throwable;
//     }
// 
//     public static final class ErrorDataBuilder {
// 
//         protected String id;
//         protected LoggingLevel loggingLevel;
//         protected String requestMethod;
//         protected String requestUri;
//         protected HttpStatus responseStatus;
//         protected List<Error> errors = new ErrorsLoggingList();
//         protected Throwable throwable;
// 
//         private ErrorDataBuilder() {
//             id = randomAlphanumeric(ERRORS_ID_LENGTH).toLowerCase();
//         }
// 
//         public static ErrorDataBuilder newErrorData() {
//             return new ErrorDataBuilder();
//         }
// 
//         public ErrorDataBuilder withLoggingLevel(LoggingLevel loggingLevel) {
//             this.loggingLevel = loggingLevel;
//             return this;
//         }
// 
//         public ErrorDataBuilder withRequestMethod(String requestMethod) {
//             this.requestMethod = requestMethod;
//             return this;
//         }
// 
//         public ErrorDataBuilder withRequestUri(String requestUri) {
//             this.requestUri = requestUri;
//             return this;
//         }
// 
//         public ErrorDataBuilder withResponseStatus(HttpStatus responseStatus) {
//             this.responseStatus = responseStatus;
//             return this;
//         }
// 
//         public ErrorDataBuilder addError(Error error) {
//             errors.add(error);
//             return this;
//         }
// 
//         public ErrorDataBuilder withThrowable(Throwable throwable) {
//             this.throwable = throwable;
//             return this;
//         }
// 
//         public ErrorData build() {
//             return new ErrorData(id, loggingLevel, requestMethod, requestUri, responseStatus, errors, throwable);
//         }
//     }
// }


import com.github.mkopylec.errorest.configuration.ErrorestProperties;
import com.github.mkopylec.errorest.handling.errordata.ErrorData;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.http.HttpStatus;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.multipart.support.MissingServletRequestPartException;
import javax.servlet.http.HttpServletRequest;
import static org.apache.commons.lang3.StringUtils.uncapitalize;
import static org.springframework.http.HttpStatus.BAD_REQUEST;
package com.github.mkopylec.errorest.handling.errordata.http;




public class MissingServletRequestPartErrorDataProvider extends HttpClientErrorDataProvider<MissingServletRequestPartException> {

    public MissingServletRequestPartErrorDataProvider(ErrorestProperties errorestProperties) {
        super(errorestProperties);
    }

    @Override
    public ErrorData getErrorData(MissingServletRequestPartException ex, HttpServletRequest request) {
        return getErrorData(ex, request, BAD_REQUEST);
    }

    @Override
// Path: src/main/java/com/github/mkopylec/errorest/configuration/ErrorestProperties.java
// @ConfigurationProperties("errorest")
// public class ErrorestProperties {
// 
//     /**
//      * HTTP response body format.
//      */
//     private ResponseBodyFormat responseBodyFormat = FULL;
//     /**
//      * Properties responsible for handling validation errors.
//      */
//     private BeanValidationError beanValidationError = new BeanValidationError();
//     /**
//      * Properties responsible for handling 4xx HTTP errors.
//      */
//     private HttpClientError httpClientError = new HttpClientError();
// 
//     public ResponseBodyFormat getResponseBodyFormat() {
//         return responseBodyFormat;
//     }
// 
//     public void setResponseBodyFormat(ResponseBodyFormat responseBodyFormat) {
//         this.responseBodyFormat = responseBodyFormat;
//     }
// 
//     public BeanValidationError getBeanValidationError() {
//         return beanValidationError;
//     }
// 
//     public void setBeanValidationError(BeanValidationError beanValidationError) {
//         this.beanValidationError = beanValidationError;
//     }
// 
//     public HttpClientError getHttpClientError() {
//         return httpClientError;
//     }
// 
//     public void setHttpClientError(HttpClientError httpClientError) {
//         this.httpClientError = httpClientError;
//     }
// 
//     public enum ResponseBodyFormat {
//         WITHOUT_DESCRIPTIONS, FULL
//     }
// 
//     public static class BeanValidationError {
// 
//         /**
//          * Validation errors logging level.
//          */
//         private LoggingLevel loggingLevel = WARN;
// 
//         public LoggingLevel getLoggingLevel() {
//             return loggingLevel;
//         }
// 
//         public void setLoggingLevel(LoggingLevel loggingLevel) {
//             this.loggingLevel = loggingLevel;
//         }
//     }
// 
//     public static class HttpClientError {
// 
//         /**
//          * HTTP 4xx errors logging level.
//          */
//         private LoggingLevel loggingLevel = WARN;
// 
//         public LoggingLevel getLoggingLevel() {
//             return loggingLevel;
//         }
// 
//         public void setLoggingLevel(LoggingLevel loggingLevel) {
//             this.loggingLevel = loggingLevel;
//         }
//     }
// }
// 
// Path: src/main/java/com/github/mkopylec/errorest/handling/errordata/ErrorData.java
// public class ErrorData {
// 
//     public static final int ERRORS_ID_LENGTH = 10;
// 
//     protected final String id;
//     protected final LoggingLevel loggingLevel;
//     protected final String requestMethod;
//     protected final String requestUri;
//     protected final HttpStatus responseStatus;
//     protected final List<Error> errors;
//     protected final Throwable throwable;
// 
//     protected ErrorData(String id, LoggingLevel loggingLevel, String requestMethod, String requestUri, HttpStatus responseStatus, List<Error> errors, Throwable throwable) {
//         this.id = id;
//         this.loggingLevel = loggingLevel;
//         this.requestMethod = requestMethod;
//         this.requestUri = requestUri;
//         this.responseStatus = responseStatus;
//         this.errors = errors;
//         this.throwable = throwable;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public LoggingLevel getLoggingLevel() {
//         return loggingLevel;
//     }
// 
//     public boolean hasLoggingLevel(LoggingLevel level) {
//         return loggingLevel == level;
//     }
// 
//     public String getRequestMethod() {
//         return requestMethod;
//     }
// 
//     public String getRequestUri() {
//         return requestUri;
//     }
// 
//     public HttpStatus getResponseStatus() {
//         return responseStatus;
//     }
// 
//     public List<Error> getErrors() {
//         return errors;
//     }
// 
//     public Throwable getThrowable() {
//         return throwable;
//     }
// 
//     public static final class ErrorDataBuilder {
// 
//         protected String id;
//         protected LoggingLevel loggingLevel;
//         protected String requestMethod;
//         protected String requestUri;
//         protected HttpStatus responseStatus;
//         protected List<Error> errors = new ErrorsLoggingList();
//         protected Throwable throwable;
// 
//         private ErrorDataBuilder() {
//             id = randomAlphanumeric(ERRORS_ID_LENGTH).toLowerCase();
//         }
// 
//         public static ErrorDataBuilder newErrorData() {
//             return new ErrorDataBuilder();
//         }
// 
//         public ErrorDataBuilder withLoggingLevel(LoggingLevel loggingLevel) {
//             this.loggingLevel = loggingLevel;
//             return this;
//         }
// 
//         public ErrorDataBuilder withRequestMethod(String requestMethod) {
//             this.requestMethod = requestMethod;
//             return this;
//         }
// 
//         public ErrorDataBuilder withRequestUri(String requestUri) {
//             this.requestUri = requestUri;
//             return this;
//         }
// 
//         public ErrorDataBuilder withResponseStatus(HttpStatus responseStatus) {
//             this.responseStatus = responseStatus;
//             return this;
//         }
// 
//         public ErrorDataBuilder addError(Error error) {
//             errors.add(error);
//             return this;
//         }
// 
//         public ErrorDataBuilder withThrowable(Throwable throwable) {
//             this.throwable = throwable;
//             return this;
//         }
// 
//         public ErrorData build() {
//             return new ErrorData(id, loggingLevel, requestMethod, requestUri, responseStatus, errors, throwable);
//         }
//     }
// }


// Path: src/main/java/com/github/mkopylec/errorest/handling/errordata/http/MissingServletRequestPartErrorDataProvider.java
import com.github.mkopylec.errorest.configuration.ErrorestProperties;
import com.github.mkopylec.errorest.handling.errordata.ErrorData;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.http.HttpStatus;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.multipart.support.MissingServletRequestPartException;
import javax.servlet.http.HttpServletRequest;
import static org.apache.commons.lang3.StringUtils.uncapitalize;
import static org.springframework.http.HttpStatus.BAD_REQUEST;

package com.github.mkopylec.errorest.handling.errordata.http;




public class MissingServletRequestPartErrorDataProvider extends HttpClientErrorDataProvider<MissingServletRequestPartException> {

    public MissingServletRequestPartErrorDataProvider(ErrorestProperties errorestProperties) {
        super(errorestProperties);
    }

    @Override
    public ErrorData getErrorData(MissingServletRequestPartException ex, HttpServletRequest request) {
        return getErrorData(ex, request, BAD_REQUEST);
    }

    @Override
    public ErrorData getErrorData(MissingServletRequestPartException ex, HttpServletRequest request, HttpStatus responseHttpStatus, ErrorAttributes errorAttributes, WebRequest webRequest) {