public Schema GetEdFiEntityExtensionBridgeSchema(ResourceClassBase resource, ISwaggerResourceContext resourceContext)
 {
     return(resource.Extensions.Any(extension => _documentContext.IsIncludedExtension(extension.ObjectType))
         ? new Schema
     {
         @ref = SwaggerDocumentHelper.GetDefinitionReference(SwaggerDocumentHelper.GetEdFiExtensionBridgeName(resource, resourceContext))
     }
         : null);
 }
Example #2
0
        private IDictionary <string, Schema> CreateEdFiExtensionSchemas(ResourceClassBase resourceClassBase, ISwaggerResourceContext 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(
                    SwaggerDocumentHelper.GetEdFiExtensionBridgeName(resourceClassBase, resourceContext),
                    bridgeSchema);
            }

            return(extensions);
        }