mirror of https://github.com/Squidex/squidex.git
14 changed files with 175 additions and 106 deletions
@ -1,4 +1,4 @@ |
|||||
<?xml version="1.0" encoding="utf-8" ?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<Weavers> |
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
||||
<Freezable/> |
<Freezable /> |
||||
</Weavers> |
</Weavers> |
||||
@ -0,0 +1,21 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
||||
|
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuild. --> |
||||
|
<xs:element name="Weavers"> |
||||
|
<xs:complexType> |
||||
|
<xs:all> |
||||
|
<xs:element name="Freezable" minOccurs="0" maxOccurs="1" type="xs:anyType" /> |
||||
|
</xs:all> |
||||
|
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>'true' to run assembly verification on the target assembly after all weavers have been finished.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
||||
|
<xs:annotation> |
||||
|
<xs:documentation>A comma separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
||||
|
</xs:annotation> |
||||
|
</xs:attribute> |
||||
|
</xs:complexType> |
||||
|
</xs:element> |
||||
|
</xs:schema> |
||||
@ -0,0 +1,41 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.Extensions.Options; |
||||
|
using NSwag.SwaggerGeneration.Processors; |
||||
|
using NSwag.SwaggerGeneration.Processors.Contexts; |
||||
|
using Squidex.Config; |
||||
|
using Squidex.Infrastructure.Tasks; |
||||
|
|
||||
|
namespace Squidex.Areas.Api.Config.Swagger |
||||
|
{ |
||||
|
public class LogoProcessor : IDocumentProcessor |
||||
|
{ |
||||
|
private const string Background = "#3f83df"; |
||||
|
|
||||
|
private readonly string logo; |
||||
|
|
||||
|
public LogoProcessor(IOptions<MyUrlsOptions> urlOptions) |
||||
|
{ |
||||
|
logo = urlOptions.Value.BuildUrl("images/logo-white.png", false); |
||||
|
} |
||||
|
|
||||
|
public Task ProcessAsync(DocumentProcessorContext context) |
||||
|
{ |
||||
|
context.Document.BasePath = Constants.ApiPrefix; |
||||
|
|
||||
|
context.Document.Info.ExtensionData = new Dictionary<string, object> |
||||
|
{ |
||||
|
["x-logo"] = new { url = logo, backgroundColor = Background } |
||||
|
}; |
||||
|
|
||||
|
return TaskHelper.Done; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue