1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-13 11:17:26 +02:00

fix: make username nullable in user-schema

I noticed I was getting warnings logged in my local instance when
visiting the users page (`/admin/users`)

```json
{
    "schema": "#/components/schemas/publicSignupTokensSchema",
    "errors": [
        {
            "instancePath": "/tokens/0/users/0/username",
            "schemaPath": "#/components/schemas/userSchema/properties/username/type",
            "keyword": "type",
            "params": {
                "type": "string"
            },
            "message": "must be string"
        }
    ]
}
```

It was complaining because one of my users doesn't have a username, so
the value returned from the API was:

```json
{
	"users": [
		{
			"id": 2,
			"name": "2mas",
			"username": null
		}
	]
}
```

This adjustment fixes that oversight by allowing `null` values for the username.
This commit is contained in:
Thomas Heartman 2023-12-15 13:53:48 +01:00
parent eebe43fcb1
commit 315c8aa8a5
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -36,6 +36,7 @@ export const userSchema = {
description: 'A unique username for the user',
type: 'string',
example: 'hunter',
nullable: true,
},
imageUrl: {
description: `URL used for the userprofile image`,