Ejemplo n.º 1
0
 public Schema GetEdFiEntityExtensionBridgeSchema(ResourceClassBase resource, IOpenApiMetadataResourceContext resourceContext)
 {
     return(resource.Extensions.Any(extension => _documentContext.IsIncludedExtension(extension.ObjectType))
         ? new Schema
     {
         @ref = OpenApiMetadataDocumentHelper.GetDefinitionReference(OpenApiMetadataDocumentHelper.GetEdFiExtensionBridgeName(resource, resourceContext))
     }
         : null);
 }
Ejemplo n.º 2
0
 public Schema GetEdFiExtensionBridgeSchema(ResourceClassBase resourceClassBase, IOpenApiMetadataResourceContext resourceContext)
 {
     return(new Schema
     {
         type = "object",
         properties = resourceClassBase.ExtensionByName
                      .Where(kvp => _documentContext.IsIncludedExtension(kvp.Value.ObjectType))
                      .ToDictionary(
             pair => pair.Key,
             pair =>
             new Schema
         {
             @ref =
                 OpenApiMetadataDocumentHelper.GetDefinitionReference(
                     OpenApiMetadataDocumentHelper
                     .GetResourceExtensionDefinitionName(
                         pair.Value,
                         resourceContext))
         })
     });
 }