diff --git a/processor/processor.go b/processor/processor.go
index 0b5d1f6..7234cde 100644
--- a/processor/processor.go
+++ b/processor/processor.go
@@ -567,6 +567,8 @@ func parseMarkers(markers markers.MarkerValues) (string, []string) {
// E.g. "XValidation: {self.page < 200 Please start a new book.}"
case "XValidation":
continue
+ case "Required", "Optional":
+ value = "True"
}
validation = append(validation, fmt.Sprintf("%s: %v", name, value))
}
@@ -581,12 +583,12 @@ func parseMarkers(markers markers.MarkerValues) (string, []string) {
// Handle standalone +required and +k8s:required marker
// This is equivalent to +kubebuilder:validation:Required
if name == "required" || name == "k8s:required" {
- validation = append(validation, "Required: {}")
+ validation = append(validation, "Required: True")
}
// Handle standalone +optional and +k8s:optional marker
// This is equivalent to +kubebuilder:validation:Optional
if name == "optional" || name == "k8s:optional" {
- validation = append(validation, "Optional: {}")
+ validation = append(validation, "Optional: True")
}
}
diff --git a/test/expected.asciidoc b/test/expected.asciidoc
index c409249..68a3a12 100644
--- a/test/expected.asciidoc
+++ b/test/expected.asciidoc
@@ -162,7 +162,7 @@ GuestbookEntry defines an entry in a guest book. See https://example.com/old-pag
| Field | Description | Default | Validation
| *`name`* __string__ | Name of the guest (pipe \| should be escaped). See https://example.com/old-page for naming guidance. + | | MaxLength: 80 +
Pattern: `0\*[a-z0-9]*[a-z]*[0-9]` +
-Required: \{} +
+Required: True +
| *`tags`* __string array__ | Tags of the entry. + | | items:Pattern: `[a-z]*` +
@@ -180,13 +180,13 @@ Looks good? + | | Pattern: `0\*[a-z0-9]*[a-z]\*[0-9]*\|\s` +
| *`rating`* __xref:{anchor_prefix}-github-com-elastic-crd-ref-docs-api-v1-rating[$$Rating$$]__ | Rating provided by the guest + | | Maximum: 5 +
Minimum: 1 +
-| *`email`* __string__ | Email is the email address of the guest (required field using +required marker) + | | Required: \{} +
+| *`email`* __string__ | Email is the email address of the guest (required field using +required marker) + | | Required: True +
-| *`location`* __string__ | Location is the location of the guest (required field using +k8s:required marker) + | | Required: \{} +
+| *`location`* __string__ | Location is the location of the guest (required field using +k8s:required marker) + | | Required: True +
-| *`phone`* __string__ | Phone is the phone number of the guest (optional field using +optional marker) + | | Optional: \{} +
+| *`phone`* __string__ | Phone is the phone number of the guest (optional field using +optional marker) + | | Optional: True +
-| *`company`* __string__ | Company is the company of the guest (optional field using +k8s:optional marker) + | | Optional: \{} +
+| *`company`* __string__ | Company is the company of the guest (optional field using +k8s:optional marker) + | | Optional: True +
|===
diff --git a/test/expected.md b/test/expected.md
index a1a1042..5755d98 100644
--- a/test/expected.md
+++ b/test/expected.md
@@ -127,15 +127,15 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
-| `name` _string_ | Name of the guest (pipe \| should be escaped). See [New page](docs-content://new/page.md) for naming guidance. | | MaxLength: 80
Pattern: `0*[a-z0-9]*[a-z]*[0-9]`
Required: \{\}
|
+| `name` _string_ | Name of the guest (pipe \| should be escaped). See [New page](docs-content://new/page.md) for naming guidance. | | MaxLength: 80
Pattern: `0*[a-z0-9]*[a-z]*[0-9]`
Required: True
|
| `tags` _string array_ | Tags of the entry. | | items:Pattern: `[a-z]*`
|
| `time` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#time-v1-meta)_ | Time of entry | | |
| `comment` _string_ | Comment by guest. This can be a multi-line comment.
Like this one.
Now let's test a list:
* a
* b
Another isolated comment.
Looks good? | | Pattern: `0*[a-z0-9]*[a-z]*[0-9]*\|\s`
|
| `rating` _[Rating](#rating)_ | Rating provided by the guest | | Maximum: 5
Minimum: 1
|
-| `email` _string_ | Email is the email address of the guest (required field using +required marker) | | Required: \{\}
|
-| `location` _string_ | Location is the location of the guest (required field using +k8s:required marker) | | Required: \{\}
|
-| `phone` _string_ | Phone is the phone number of the guest (optional field using +optional marker) | | Optional: \{\}
|
-| `company` _string_ | Company is the company of the guest (optional field using +k8s:optional marker) | | Optional: \{\}
|
+| `email` _string_ | Email is the email address of the guest (required field using +required marker) | | Required: True
|
+| `location` _string_ | Location is the location of the guest (required field using +k8s:required marker) | | Required: True
|
+| `phone` _string_ | Phone is the phone number of the guest (optional field using +optional marker) | | Optional: True
|
+| `company` _string_ | Company is the company of the guest (optional field using +k8s:optional marker) | | Optional: True
|
#### GuestbookHeader
diff --git a/test/hide.md b/test/hide.md
index 0fe4130..ebea2d0 100644
--- a/test/hide.md
+++ b/test/hide.md
@@ -128,15 +128,15 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
-| `name` _string_ | Name of the guest (pipe \| should be escaped). See [New page](docs-content://new/page.md) for naming guidance. | | MaxLength: 80
Pattern: `0*[a-z0-9]*[a-z]*[0-9]`
Required: \{\}
|
+| `name` _string_ | Name of the guest (pipe \| should be escaped). See [New page](docs-content://new/page.md) for naming guidance. | | MaxLength: 80
Pattern: `0*[a-z0-9]*[a-z]*[0-9]`
Required: True
|
| `tags` _string array_ | Tags of the entry. | | items:Pattern: `[a-z]*`
|
| `time` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#time-v1-meta)_ | Time of entry | | |
| `comment` _string_ | Comment by guest. This can be a multi-line comment.
Like this one.
Now let's test a list:
* a
* b
Another isolated comment.
Looks good? | | Pattern: `0*[a-z0-9]*[a-z]*[0-9]*\|\s`
|
| `rating` _[Rating](#rating)_ | Rating provided by the guest | | Maximum: 5
Minimum: 1
|
-| `email` _string_ | Email is the email address of the guest (required field using +required marker) | | Required: \{\}
|
-| `location` _string_ | Location is the location of the guest (required field using +k8s:required marker) | | Required: \{\}
|
-| `phone` _string_ | Phone is the phone number of the guest (optional field using +optional marker) | | Optional: \{\}
|
-| `company` _string_ | Company is the company of the guest (optional field using +k8s:optional marker) | | Optional: \{\}
|
+| `email` _string_ | Email is the email address of the guest (required field using +required marker) | | Required: True
|
+| `location` _string_ | Location is the location of the guest (required field using +k8s:required marker) | | Required: True
|
+| `phone` _string_ | Phone is the phone number of the guest (optional field using +optional marker) | | Optional: True
|
+| `company` _string_ | Company is the company of the guest (optional field using +k8s:optional marker) | | Optional: True
|
#### GuestbookHeader