Skip to content

Issue: type of "default" value for fields is "string". #306

@landure

Description

@landure

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions