Example #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);
 }
Example #2
0
        private IDictionary <string, Schema> CreateEdFiExtensionSchemas(ResourceClassBase resourceClassBase, IOpenApiMetadataResourceContext resourceContext)
        {
            var extensions = new Dictionary <string, Schema>();

            //Add the bridge extension object with all extension references.
            var bridgeSchema = _bridgeStrategy.GetEdFiExtensionBridgeSchema(resourceClassBase, resourceContext);

            if (bridgeSchema != null)
            {
                extensions.Add(
                    OpenApiMetadataDocumentHelper.GetEdFiExtensionBridgeName(resourceClassBase, resourceContext),
                    bridgeSchema);
            }

            return(extensions);
        }