sciapp / sampledb

Sample and Measurement Metadata Database
https://scientific-it-systems.iffgit.fz-juelich.de/SampleDB/
MIT License
21 stars 11 forks source link

Required text fields not required (+Required * missing) #43

Closed NilsWeber98 closed 1 year ago

NilsWeber98 commented 1 year ago

Hej,

during creating and testing multiple actions, I was able to not fill required text fields. I created some required text fields. However, I was able to save and create a object without that information. Additionally, I was able to leave empty the name in the action.

See simple example action to reproduce:

{
    "title": "",
    "type": "object",
    "properties": {
        "name": {
            "title": "Name",
            "type": "text"
        },
        "text": {
            "title": "Text",
            "type": "text"
        }
    },
    "required": [
        "name",
        "text"
    ],
    "propertyOrder": [
        "name",
        "text"
    ]
}

See empty result:

image

Additionally, the * indicating the required field like in this case is not visible as well.

image

Our version is based on commit 04dff4bc0feae2bb41f606ea8bf2241a45c79d99

FlorianRhiem commented 1 year ago

If you set a minLength, it will require input. Otherwise empty input will be the valid text "", an empty string. The * would be misleading in that case.

NilsWeber98 commented 1 year ago

I see your point. Thank you! If I add the pattern option (e.g. "pattern": "[A-Z][0-9]"), there is still no appearing. I think the star would be helpful there as well. But now I know how to get it by adding minLength as well.