Exemplo n.º 1
0
        public JsonSchemaProperty?Visit(IField <ReferencesFieldProperties> field, Args args)
        {
            var property = JsonTypeBuilder.ArrayProperty(JsonTypeBuilder.String());

            property.Default = field.Properties.DefaultValue;

            if (field.Properties.MinItems != null)
            {
                property.MinItems = field.Properties.MinItems.Value;
            }

            if (field.Properties.MaxItems != null)
            {
                property.MaxItems = field.Properties.MaxItems.Value;
            }

            property.ExtensionData = new Dictionary <string, object>
            {
                ["schemaIds"] = field.Properties.SchemaIds ?? ReadonlyList.Empty <DomainId>()
            };

            property.UniqueItems = !field.Properties.AllowDuplicates;

            return(property);
        }
        private Task <IReadOnlyList <IAssetFolderEntity> > GetAssetPathAsync(DomainId parentId, AssetFolderScope scope)
        {
            if (scope == AssetFolderScope.Items)
            {
                return(Task.FromResult <IReadOnlyList <IAssetFolderEntity> >(ReadonlyList.Empty <IAssetFolderEntity>()));
            }

            return(assetQuery.FindAssetFolderAsync(Context.App.Id, parentId, HttpContext.RequestAborted));
        }
Exemplo n.º 3
0
        public async Task Should_not_add_error_if_schemas_is_empty()
        {
            var trigger = new ContentChangedTriggerV2
            {
                Schemas = ReadonlyList.Empty <ContentChangedTriggerSchemaV2>()
            };

            var errors = await RuleTriggerValidator.ValidateAsync(appId.Id, trigger, appProvider);

            Assert.Empty(errors);
        }
Exemplo n.º 4
0
        public JsonSchemaProperty?Visit(IField <ReferencesFieldProperties> field, Args args)
        {
            var property = JsonTypeBuilder.ArrayProperty(JsonTypeBuilder.String());

            property.Format = GeoJson.Format;

            property.ExtensionData = new Dictionary <string, object>
            {
                ["schemaIds"] = field.Properties.SchemaIds ?? ReadonlyList.Empty <DomainId>()
            };

            return(property);
        }