Skip to content

Mention Body cannot be empty in Common validation errors when creating issue forms #19939

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ Errors with `body` will be prefixed with `body[i]` where `i` represents the inde

### Example

```
```yaml
body:
- type: dropdown
attributes:
Expand All @@ -552,7 +552,7 @@ body:

The error can be fixed by ensuring that no duplicate choices exist in the `options` array.

```
```yaml
body:
- type: dropdown
attributes:
Expand All @@ -570,7 +570,7 @@ Errors with `body` will be prefixed with `body[i]` where `i` represents the inde

### Example

```
```yaml
body:
- type: dropdown
attributes:
Expand All @@ -585,7 +585,7 @@ body:

The error can be fixed by removing "None" as an option. If you want a contributor to be able to indicate that they like none of those types of pies, you can additionally remove the `required` validation.

```
```yaml
body:
- type: dropdown
attributes:
Expand All @@ -605,7 +605,7 @@ Errors with `body` will be prefixed with `body[i]` where `i` represents the inde

### Example

```
```yaml
body:
- type: dropdown
attributes:
Expand All @@ -618,7 +618,7 @@ body:

The error can be fixed by wrapping each offending option in quotes, to prevent them from being processed as Boolean values.

```
```yaml
body:
- type: dropdown
attributes:
Expand All @@ -629,6 +629,36 @@ body:
- Maybe
```

## Body cannot be empty

The template body `key:value` pair can not be empty. For more information about which top-level keys are required, see "[Syntax for issue forms](/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax)."
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't can not be cannot?


The error can be fixed by adding the `body:` section.

### Example

```yaml
name: Support Request
description: Something went wrong and you need help?
---
body:
- type: textarea
attributes:
label: "What's wrong?"
```

In this example, the error can be fixed by deleting the `---` (document separator) between the headers and the `body` section.

```yaml
name: Support Request
description: Something went wrong and you need help?

body:
- type: textarea
attributes:
label: "What's wrong?"
```

## Further reading

- [YAML](https://yaml.org/)
Expand Down