Skarlso / crd-to-sample-yaml

Generate a sample YAML file from a CRD and view it rendered on a nice website
https://crdtoyaml.com/
Apache License 2.0
108 stars 16 forks source link

Idea/Feature Request: Support for Generating Examples from CompositeResourceDefinitions (XRDs) #117

Open markussiebert opened 10 hours ago

markussiebert commented 10 hours ago

Problem Statement

While the tool currently offers valuable functionality for generating example YAML files from Kubernetes Custom Resource Definitions (CRDs), many users working within the Crossplane ecosystem require similar support for CompositeResourceDefinitions (XRDs).

XRDs are a core component of Crossplane, allowing users to define their own custom resources. Having the ability to generate example YAML files from XRDs would significantly enhance the tool's utility for Crossplane users, streamlining their development process and reducing manual effort.

Proposed Solution

Extend the tool to include functionality that:

  1. Automatically generates example YAML files from CompositeResourceDefinitions (XRDs). Maybe via autodetection?

This should be a relatively small change to implement, as XRDs essentially contain a CRD, with the OpenAPI part being identical. Therefore, the existing logic for CRDs can be reused with minor adjustments to accommodate the XRD-specific structures.

Benefits

Conclusion

By adding support for generating example YAMLs from CompositeResourceDefinitions (XRDs), we can significantly broaden the tool's appeal and utility. This feature would be a valuable addition, catering specifically to users within the Crossplane ecosystem and improving their workflow efficiency. Implementing this change should be relatively straightforward given the similarities between CRDs and XRDs.

What do you think?

Skarlso commented 10 hours ago

Sure! 👍