Open incy-tron opened 1 year ago
In your screenshot, os_minorversion
has a number 5
as value (colored red), and os_version
is a string with value "7"
(colored green). You can change between number/string via the context menu, type, auto or string.
Thanks for the prompt reply!
Ok. It was set to Auto, is there a way for me through the API to automatically set that? I don't want users to have to worry about.
Steig
From: Jos de Jong @.> Sent: Thursday, July 27, 2023 12:07 PM To: josdejong/jsoneditor @.> Cc: Hallquist, Steig @.>; Author @.> Subject: [External] - Re: [josdejong/jsoneditor] Inconsistent validation for string type fields. (Issue #1541)
CAUTION: External email.
In your screenshot, os_minorversion has a number 5 as value (colored red), and os_version is a string with value "7" (colored green). You can change between number/string via the context menu, type, auto or string.
— Reply to this email directly, view it on GitHubhttps://github.com/josdejong/jsoneditor/issues/1541#issuecomment-1653919721, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AU6OD4R6SN6WGW6T6YICL23XSKG25ANCNFSM6AAAAAA22CFC2Y. You are receiving this because you authored the thread.Message ID: @.***>
This communication, including any attachments, may contain Proprietary, Export Controlled, Legally Privileged or other Confidential Information. Any unauthorized review, printing, copying, transmission, dissemination, or use of the information is strictly prohibited. If you are not the intended recipient, please indicate to the sender that you have received this email in error, and delete the copy you received.
It just displays what you provide it. The editor normally loads values with "auto" mode. There is only one case where it sets the value type to string and keeps it like that (until you manually change the type): when a value is a string containing a numeric value.
So if you load the following example:
{
"os_version": "7"
}
the value of "os_version"
will have type string
until you manually change that.
In the following example, the type is auto
:
{
"os_version": 7
}
I have multiple fields where the type is defined as: [string, null] some fields will allow a integer value whereas other will show a warning. For example, I have two fields defined as:
Os Version doesn't show a warning when entering an integer, however, Os Minorversion will.
I'm using jsoneditor v9.10.2 within an Angular v14.3.0 project.
I've tried rolling back all the way to jsoneditor v9.7.4, but this issue still persists.