Boolean traits shows as fields, any input leads to mismatch of types sting!=boolean
Closed this issue · 3 comments
DeamonMV commented
Describe the bug
Boolean traits shows as fields, any input leads to mismatch of types sting!=boolean, which lead to problem to update the traits.
To Reproduce
Steps to reproduce the behavior:
- create a JSON schema
{
"$id": "https://schemas.ory.sh/presets/kratos/quickstart/email-password/identity.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Person",
"type": "object",
"definitions": {
"tosUrl": {
"type": "string",
"const": "http://example.com/terms"
}
},
"properties": {
"traits": {
"type": "object",
"properties": {
"email": {
"type": "string",
"format": "email",
"title": "E-Mail",
"minLength": 3,
"ory.sh/kratos": {
"credentials": {
"password": {
"identifier": true
}
},
"verification": {
"via": "email"
},
"recovery": {
"via": "email"
}
}
},
"username": {
"title": "Username",
"type": "string",
"readOnly": true
},
"name": {
"type": "object",
"properties": {
"first": {
"title": "First Name",
"type": "string"
},
"last": {
"title": "Last Name",
"type": "string"
}
}
},
"tos": {
"title": "Accept Terms of Service",
"type": "boolean",
"description": "I accept the terms of service",
"writeOnly": true,
"tosUrl": {
"$ref": "#/definitions/tosUrl"
}
},
"newsletter": {
"type": "boolean",
"title": "Newsletter subscription"
}
},
"required": [
"email",
"username",
"tos"
],
"additionalProperties": false
}
}
}
- register and verify user
- open kratos-admin-ui
- open created user on edit
- update any boolean traits -
Accept Terms of Service
orNewsletter subscription
- See error
{"code":400,"status":"Bad Request","reason":"I[#/traits/newsletter] S[#/properties/traits/properties/newsletter/type] expected boolean, but got string","message":"The request was malformed or contained invalid parameters"}
Expected behavior
kratos-admin-ui shows checkbox as a checkbox, update of the checkbox passes without errors
Desktop (please complete the following information):
- OS: windows 10
- Browser chrome
- Version
123.0.6312.123
Additional context
kratos version 1.1.0
kratos-admin-ui used inside docker-compose.yaml as this
kratos-admin-ui:
image: ghcr.io/dfoxg/kratos-admin-ui
ports:
- 8080:8080
environment:
- KRATOS_ADMIN_URL=http://kratos:4434
- KRATOS_PUBLIC_URL=http://kratos:4433
depends_on:
- kratos
- auth-db
networks:
- intranet
dfoxg commented
Thanks for reporting that, i'll have a look at it :)
dfoxg commented
Added with https://github.com/dfoxg/kratos-admin-ui/releases/tag/v2.3.2. Could you test it? :)