36 lines
990 B
C#
36 lines
990 B
C#
using Core;
|
|
using Core.Yaml;
|
|
using Generator.Daos;
|
|
|
|
namespace Generator.DataSource.Yaml;
|
|
|
|
public class YamlDirector
|
|
{
|
|
|
|
private readonly OpenApiDao _openApiDao;
|
|
|
|
public YamlDirector(OpenApiDao openApiDao)
|
|
{
|
|
_openApiDao = openApiDao;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Build a yaml object lmao what do you want me to say ? All the information's are in the method signature
|
|
/// </summary>
|
|
/// <param name="specPath"></param>
|
|
/// <returns></returns>
|
|
public OpenApiYaml BuildYaml(string specPath)
|
|
{
|
|
var openApiConfig = _openApiDao.GetOpenApi(true, specPath);
|
|
var yamlBuilder = new YamlBuilder(openApiConfig.SpecFile.ToString(), openApiConfig.ConfigIdentifier);
|
|
|
|
yamlBuilder.LoadSpec();
|
|
yamlBuilder.AddReferences();
|
|
yamlBuilder.LoadConfigs();
|
|
yamlBuilder.SelectConfig();
|
|
yamlBuilder.AddSchema();
|
|
yamlBuilder.AddIgnoredModels();
|
|
|
|
return yamlBuilder.Create();
|
|
}
|
|
} |