Import from internal git
This commit is contained in:
36
Generator/DataSource/Yaml/YamlDirector.cs
Normal file
36
Generator/DataSource/Yaml/YamlDirector.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user