org.openapi4j.parser.validation.v3.EncodingPropertyValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openapi-parser Show documentation
Show all versions of openapi-parser Show documentation
openapi4j schema parser & validator
package org.openapi4j.parser.validation.v3;
import org.openapi4j.core.validation.ValidationResults;
import org.openapi4j.parser.model.v3.EncodingProperty;
import org.openapi4j.parser.model.v3.OpenApi3;
import org.openapi4j.parser.validation.ValidationContext;
import org.openapi4j.parser.validation.Validator;
import static org.openapi4j.parser.validation.v3.OAI3Keywords.*;
class EncodingPropertyValidator extends Validator3Base {
private static final Validator INSTANCE = new EncodingPropertyValidator();
private EncodingPropertyValidator() {
}
public static Validator instance() {
return INSTANCE;
}
@Override
public void validate(ValidationContext context, OpenApi3 api, EncodingProperty encodingProperty, ValidationResults results) {
// VALIDATION EXCLUSIONS :
// explode
validateString(encodingProperty.getContentType(), results, false, CRUMB_CONTENTTYPE);
validateMap(context, api, encodingProperty.getExtensions(), results, false, CRUMB_EXTENSIONS, Regexes.EXT_REGEX, null);
validateMap(context, api, encodingProperty.getHeaders(), results, false, CRUMB_HEADERS, Regexes.NOEXT_REGEX, null);
validateString(encodingProperty.getStyle(), results, false, Regexes.STYLE_REGEX, CRUMB_STYLE);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy