Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

select inputType and number type #50

Closed
gaou-piou opened this issue Oct 20, 2023 · 2 comments
Closed

select inputType and number type #50

gaou-piou opened this issue Oct 20, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@gaou-piou
Copy link

gaou-piou commented Oct 20, 2023

i have this json schema

{
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "AccountType": {
            "title": "Select account type",
            "description": "",
            "x-jsf-presentation": {
                "inputType": "select"
            },
            "oneOf": [
                {
                    "title": "Normal User",
                    "const": 0
                },
                {
                    "title": "Business",
                    "const": 1
                },
                {
                    "title": "Services Provider",
                    "const": 2
                }
            ],
            "type": "number"
        }
    },
    "required": [],
    "x-jsf-order": [
        "AccountType"
    ]
}

and on validation cannot accepts that value must be number and not string
as the output field is (it has schema type : string)

{
    "type": "select",
    "name": "AccountType",
    "label": "Select account type",
    "options": [
        {
            "label": "Normal User",
            "value": 0
        },
        {
            "label": "Business",
            "value": 1
        },
        {
            "label": "Services Provider",
            "value": 2
        }
    ],
    "required": false,
    "inputType": "select",
    "jsonType": "number",
    "computedAttributes": {},
    "description": "",
    "errorMessage": {},
    "schema": {
        "_deps": [],
        "_conditions": [],
        "_options": {
            "abortEarly": true,
            "recursive": true
        },
        "_exclusive": {},
        "_whitelist": {
            "list": {},
            "refs": {}
        },
        "_blacklist": {
            "list": {},
            "refs": {}
        },
        "tests": [],
        "transforms": [
            null,
            null
        ],
        "type": "string",
        "_type": "string",
        "_nullable": true
    },
    "scopedJsonSchema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
            "AccountType": {
                "title": "Select account type",
                "description": "",
                "x-jsf-presentation": {
                    "inputType": "select"
                },
                "oneOf": [
                    {
                        "title": "Normal User",
                        "const": 0
                    },
                    {
                        "title": "Business",
                        "const": 1
                    },
                    {
                        "title": "Services Provider",
                        "const": 2
                    }
                ],
                "type": "number"
            }
        },
        "required": [],
        "x-jsf-order": [
            "AccountType"
        ]
    },
    "isVisible": true
}
@brennj
Copy link
Collaborator

brennj commented Oct 24, 2023

A happy coincidence! We are running into this issue internally. #49 should solve this.

@sandrina-p
Copy link
Collaborator

Closing as it was solved by #49 :)

@sandrina-p sandrina-p added the bug Something isn't working label Sep 25, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants