Add a `crossplane xrd lint` command
- Dominant language
- Go
- Stars
- 19
- Forks
- 31
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 52
Description
### What problem are you facing?
https://github.com/crossplane/docs/issues/564 tracks documenting best practices for API design. Put otherwise, best practices for writing XRDs. It occurred to me today that we could probably write a linter for a lot of these.
It could make sense for this to be part of `crossplane beta validate` too, but I think validation and linting are slightly different things. An XRD could have a valid OpenAPI schema, but one that we wouldn't recommend.
### How could Crossplane help solve your problem?
Add a linter for XRDs. Some things to look for:
* Overly restrictive status fields. Status fields aren't written by users, so they typically shouldn't be required, or generally validated beyond their type (e.g maximum integers, etc).
* Arrays of objects missing a `name` field.
* Boolean fields, which Kubernetes API conventions would typically recommend be enums.
* Missing server-side apply merge OpenAPI extensions where we'd expect them.
* General OpenAPI hygiene - fields missing descriptions etc
Contributor guide
Assessment
This issue has not been assessed yet.