-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
appsettings : ImageFileTypes Schema Vs Docs is wrong #14131
Comments
Hi there @TRexStark! Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better. We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
Hey @TRexStark it looks like your schema may be a bit out of date, I'd recommend trying to delete it and rebuild, this should regenerate it, looking at my own test project the schema correctly specifies it as an array: |
Thanks @nikolajlauridsen. Unfortunately, that didn't work for me. I went to check the Generator in v10/main and the client referenced has the same issues outlined. |
I also experienced the same thing on VS, even though the IntelliSense suggest correctly the array type: I also tried regenerating the schema which worked until I reopened the project in VS again .. It seems like in appsettings-schema.json we have defined "ImageFileTypes": {
"description": "Collection of accepted image file extensions",
"type": [
"string"
]
} "ImageFileTypes": {
"type": "array",
"description": "Gets or sets a value for the collection of accepted image file extensions.",
"default": "jpeg,jpg,gif,bmp,png,tiff,tif,webp",
"items": {
"type": "string"
}
}, |
Hi @TRexStark, We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know. For more information about issues and states, have a look at this blog post. Thanks muchly, from your friendly Umbraco GitHub bot :-) |
This seems to happen as well in V10 for the RichTextEditor Plugins
|
@Zeegaan I was able to reproduce the issue (both with the ImageFileTypes and the RichTextEditor Plugins) in V11.4.1 |
I believe I figured out the issue. The appsettings-schema.json is saying that both the https://json.schemastore.org/appsettings.json and the appsettings-schema.Umbraco.Cms.json apply. In the case of appsettings-schema.Umbraco.Cms.json, both the Imaging:ImageFileTypes and the RichTextEditor:Plugins are of type string array. But in the https://json.schemastore.org/appsettings.json both these properties are declared as strings. If you remove the declaration of https://json.schemastore.org/appsettings.json from the appsettings-schema.json the issue is gone. After closer inspection to https://json.schemastore.org/appsettings.json, it seems there are a lot of Umbraco specific properties there and because of this, I'm of the opinion that they should not be in a general appsettings.json schema definition. My suggestion would be to remove all umbraco specific properties from there and keep them in the appsettings-schema.Umbraco.Cms.json The umbraco settings were added to the https://json.schemastore.org/appsettings.json in this PR to the schemastore |
Have you considered moving the Umbraco settings out of the appsettings.json into a separate file (something like UmbracoSettings.json) with it's own schema? A basic version of the file (with the schema available in the project) could look something like this:
I can help implementing this change if needed. |
Hi @miguelcrpinto, Thanks for the extra effort to track this down 🙌 H5YR! |
@elit0451 considering that Umbraco is shipping with it's own schema (which depends on the CMS version) and including it in the appsettings-schema.json, shouldn't we just remove everything that is umbraco related from the https://json.schemastore.org/appsettings.json? |
Yes, that makes good sense! |
I just created the Pull request to the schemastore: SchemaStore/schemastore#3162 Once this is merged, we need to test again but the issue should be gone after refreshing the schema definition in Visual Studio (code) |
The SchemaStore PR has just been merged and it fixed the issue. If you visit https://json.schemastore.org/appsettings.json there are no more references of Umbraco You might need to force VS to reload the schemas (right click in the appsettings.json editor window): |
@TRexStark could you confirm this is no longer an issue for you? Then we can go ahead and get this closed 🚀 😊 |
Hi @Zeegaan it seems that this is no longer an issue. Thank you. I'll close it. |
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
10.5.0
Bug summary
I'm not sure if this has been raised before, but I think I've seen it somewhere and I have looked but could not find anything - so I apologise if it's a duplicate.
I wasn't sure if I should raise this here or in the Docs repo as they are both related and unsure which one is wrong (Docs Vs CMS).
It seems that the Imaging:ImageFileTypes is either using the wrong schema or the documentations may be wrong.
Specifics
Both Documentation for v10 and v11 outline an example as "ImageFileTypes": ["jpeg", "jpg", "gif", "bmp", "png", "tiff", "tif"] which is an array.
When setting this configuration in appsettings.json as per the docs, intelliSense is returning a warning as "Value must be one of the following types: string".
When inspecting appseetings-schema.json > line 923, you can see that the type for "ImageFileTypes" is set to string.
Steps to reproduce
"Umbraco": { "CMS": { "Content": { ... "Imaging": { "ImageFileTypes": ["jpeg", "jpg", "gif", "bmp", "png", "tiff", "tif"], ... }, ... } } }
UPDATE: The same goes for Plugins:properties:BrowsableFileExtensions
Expected result / actual result
either the schema and implementation or documentations need to be updated so we know what we should do.
This item has been added to our backlog AB#32240
The text was updated successfully, but these errors were encountered: