mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-03-09 12:12:21 +01:00
fix(docs): filter Optional markers from validation column
The crd-ref-docs tool v0.3.0 introduced a change that started
rendering `+optional` Go code markers as `Optional: {}` in the
validation column of API documentation. This appeared as an empty JSON
object and was redundant since the Required column already displayed
this information. This updates the documentation template to filter
out these Optional markers while preserving meaningful validation
rules like patterns and enums. It also removes redundant customMarkers
configuration.
Closes #722
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
This commit is contained in:
parent
5001fe7831
commit
34cecb0446
@ -86,7 +86,7 @@ tasks:
|
|||||||
# renovate: datasource=git-refs depName=crd-gen-refs lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
# renovate: datasource=git-refs depName=crd-gen-refs lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
||||||
DAGGER_CRDGENREF_SHA: ee59e34a99940e45f87a16177b1d640975b05b74
|
DAGGER_CRDGENREF_SHA: ee59e34a99940e45f87a16177b1d640975b05b74
|
||||||
# renovate: datasource=go depName=github.com/elastic/crd-ref-docs
|
# renovate: datasource=go depName=github.com/elastic/crd-ref-docs
|
||||||
CRDREFDOCS_VERSION: v0.2.0
|
CRDREFDOCS_VERSION: v0.3.0
|
||||||
cmds:
|
cmds:
|
||||||
- >
|
- >
|
||||||
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/crd-ref-docs@${DAGGER_CRDGENREF_SHA}
|
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/crd-ref-docs@${DAGGER_CRDGENREF_SHA}
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
processor:
|
processor:
|
||||||
ignoreGroupVersions:
|
ignoreGroupVersions:
|
||||||
- "GVK"
|
- "GVK"
|
||||||
customMarkers:
|
|
||||||
- name: "optional"
|
|
||||||
target: field
|
|
||||||
ignoreFields:
|
ignoreFields:
|
||||||
# - "status$"
|
# - "status$"
|
||||||
- "TypeMeta$"
|
- "TypeMeta$"
|
||||||
|
|||||||
@ -31,7 +31,7 @@ _Appears in:_
|
|||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
{{ range $type.Members -}}
|
{{ range $type.Members -}}
|
||||||
| `{{ .Name }}` _{{ markdownRenderType .Type }}_ | {{ template "type_members" . }} | {{ if not .Markers.optional -}}True{{- end }} | {{ markdownRenderDefault .Default }} | {{ range .Validation -}} {{ markdownRenderFieldDoc . }} <br />{{ end }} |
|
| `{{ .Name }}` _{{ markdownRenderType .Type }}_ | {{ template "type_members" . }} | {{ if not .Markers.optional -}}True{{- end }} | {{ markdownRenderDefault .Default }} | {{ range .Validation -}}{{- $v := markdownRenderFieldDoc . }}{{- if and $v (ne $v "Optional: \\{\\}") -}} {{ $v }} <br />{{ end }}{{- end }} |
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user