protected override void Arrange() { var schemaDefinition = DomainModelDefinitionsProviderHelper .DefinitionProviders .Select( x => x.GetDomainModelDefinitions() .SchemaDefinition) .Where(s => s.PhysicalName == requestedExtensionPhysicalName) .Select(s => new EdFiSchema(s.LogicalName, s.PhysicalName)) .First(); _extensionOnlySwaggerDocumentFactory = SwaggerDocumentFactoryHelper .GetExtensionOnlySwaggerDocumentFactory( DomainModelDefinitionsProviderHelper.ResourceModelProvider.GetResourceModel(), schemaDefinition); _resourceStrategy = new SdkGenExtensionResourceStrategy(); }
private IEnumerable <OpenApiContent> CreateSchemaSpecificSections() { return(new[] { new OpenApiContent( OpenApiMetadataSections.SdkGen, EdFi, new Lazy <string>( () => new SwaggerDocumentFactory( new SwaggerDocumentContext(_resourceModelProvider.GetResourceModel()) { RenderType = RenderType.GeneralizedExtensions, IsIncludedExtension = x => x.FullName.Schema.Equals(EdFiConventions.PhysicalSchemaName) }).Create(_openApiMetadataResourceFilters[EdFi])), _odsDataBasePath) }.Concat( _domainModelProvider.GetDomainModel() // All the extension schemas. .Schemas.Where( x => !x.LogicalName.EqualsIgnoreCase(EdFiConventions.LogicalName)) .Select( schema => new { UriSegment = _schemaNameMapProvider.GetSchemaMapByLogicalName(schema.LogicalName) .UriSegment, Factory = SwaggerDocumentFactoryHelper.GetExtensionOnlySwaggerDocumentFactory( _resourceModelProvider.GetResourceModel(), schema) }) .Select( sf => new OpenApiContent( OpenApiMetadataSections.Extensions, sf.UriSegment, new Lazy <string>(() => sf.Factory.Create(_openApiMetadataResourceFilters[Extensions])), _odsDataBasePath)) )); }