In the problems section of visual studio code, this message appear:
Incorrect type. Expected "string".
The message concern the default value of field "draft", which is a boolean.
Furthermore, If the default value is set to "false", it is equivalent to true in Front Matter. An empty default ("") is equivalent to false.
Expected behavior
There should be no issue with a default value with a type other than string.
And if string type is the only possibility, A default set to "false" should set the field to false.
Desktop (please complete the following information):
OS: Ubuntu 21.10 Impish Indri
**To Reproduce**
Create a custom default content type:
```
"frontMatter.taxonomy.contentTypes": [
{
"name": "default",
"pageBundle": false,
"fields": [
{
"title": "Title",
"name": "title",
"type": "string",
"single": true,
},
{
"title": "Is in draft",
"name": "draft",
"type": "draft",
"default": true
}
]
}
],
```
In the problems section of visual studio code, this message appear:
> Incorrect type. Expected "string".
The message concern the default value of field "draft", which is a boolean.
Furthermore, If the default value is set to `"false"`, it is equivalent to `true` in Front Matter. An empty default (`""`) is equivalent to `false`.
**Expected behavior**
There should be no issue with a default value with a type other than string.
And if string type is the only possibility, A default set to `"false"` should set the field to `false`.
**Desktop (please complete the following information):**
- OS: Ubuntu 21.10 Impish Indri
<!-- github-sync-id:1190903196 -->
Thanks @landure for opening this issue. The default field was indeed set to string in the schema. This just got fixed and another code fix as well. It will be available in version 7.1.0 and the latest beta.
Thanks @landure for opening this issue. The `default` field was indeed set to `string` in the schema. This just got fixed and another code fix as well. It will be available in version 7.1.0 and the latest beta.
<!-- github-comment-id:1087171712 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
To Reproduce
Create a custom default content type:
In the problems section of visual studio code, this message appear:
The message concern the default value of field "draft", which is a boolean.
Furthermore, If the default value is set to
"false", it is equivalent totruein Front Matter. An empty default ("") is equivalent tofalse.Expected behavior
There should be no issue with a default value with a type other than string.
And if string type is the only possibility, A default set to
"false"should set the field tofalse.Desktop (please complete the following information):
Thanks @landure for opening this issue. The
defaultfield was indeed set tostringin the schema. This just got fixed and another code fix as well. It will be available in version 7.1.0 and the latest beta.