kubernetes / kube-openapi

Kubernetes OpenAPI spec generation & serving
Apache License 2.0
319 stars 208 forks source link

add raw string/multiline syntax to marker comments #446

Closed alexzielenski closed 9 months ago

alexzielenski commented 10 months ago

adds ability to specify a raw/multiline string in kube-openapi marker comments to make longer strings more ergonomic to use

Syntax Example:

+k8s:validation:key> value line 1
+k8s:validation:key> value line 2

yields key="validation line 2\nvalidation line 2"

Note: Whitespace at edges are trimmed

Using = to specify multiple key-value pairs is now an error for k8s:validation prefixed items. Lists must be specified using explicit indices

/assign @Jefftree /cc @Schnides123

k8s-ci-robot commented 10 months ago

@alexzielenski: GitHub didn't allow me to request PR reviews from the following users: Schnides123.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to [this](https://github.com/kubernetes/kube-openapi/pull/446): >adds ability to specify a raw/multiline string in kube-openapi marker comments to make longer strings more ergonomic to use > >/assign @Jefftree >/cc @Schnides123 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
jpbetz commented 10 months ago

I'm okay with this as an approach. I haven't reviewed the implementation in detail. Since this is not API facing, I think we just need to get agreement on the go tag format internally.

@thockin @deads2k do you have any thoughts on this format? It seems to me that it expands our go tag support to handle the cases we need to handle, and avoids the "super long oneline gotags" that kubebuilder suffers from

jpbetz commented 9 months ago

LGTM once test issue is cleared (some kind of duplication)?

Jefftree commented 9 months ago

/lgtm /approve

k8s-ci-robot commented 9 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexzielenski, Jefftree

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes/kube-openapi/blob/master/OWNERS)~~ [Jefftree,alexzielenski] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment