All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.openapi4j.parser.validation.v3.InfoValidator Maven / Gradle / Ivy
package org.openapi4j.parser.validation.v3;
import org.openapi4j.core.validation.ValidationResults;
import org.openapi4j.parser.model.v3.Info;
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 InfoValidator extends Validator3Base {
private static final Validator INSTANCE = new InfoValidator();
private InfoValidator() {
}
public static Validator instance() {
return INSTANCE;
}
@Override
public void validate(ValidationContext context, OpenApi3 api, Info info, ValidationResults results) {
// VALIDATION EXCLUSIONS :
// description
validateField(context, api, info.getContact(), results, false, CRUMB_CONTACT, ContactValidator.instance());
validateMap(context, api, info.getExtensions(), results, false, CRUMB_EXTENSIONS, Regexes.EXT_REGEX, null);
validateField(context, api, info.getLicense(), results, false, CRUMB_LICENSE, LicenseValidator.instance());
validateUrl(api, info.getTermsOfService(), results, false, true, CRUMB_TERMSOFSERVICE);
validateString(info.getTitle(), results, true, CRUMB_TITLE);
validateString(info.getVersion(), results, true, CRUMB_VERSION);
}
}