class OpenApiGenerator implements APIGenerator {

    @Override
    public APISummary info(final String specification, final APIValidationContext validation) {
        final OpenApiModelInfo modelInfo = OpenApiModelParser.parse(specification, validation);

        final OasDocument model = modelInfo.getModel();
        if (model == null) {
            return new APISummary.Builder().errors(modelInfo.getErrors()).warnings(modelInfo.getWarnings()).build();
        }

        final OasPaths paths = model.paths;
        final ActionsSummary actionsSummary = determineSummaryFrom(OasModelHelper.getPathItems(paths));

        final Info info = model.info;
        final String title = Optional.ofNullable(info).map(i -> i.title).orElse("unspecified");
        final String description = Optional.ofNullable(info).map(i -> i.description).orElse("unspecified");

        return new APISummary.Builder()//
            .name(title)//
            .description(description)//
            .actionsSummary(actionsSummary)//
            .errors(modelInfo.getErrors())//
            .warnings(modelInfo.getWarnings())//
            // needed if the user wants to change it
            .putConfiguredProperty("specification", modelInfo.getResolvedSpecification())
            .build();
    }

}