dotnet-operator-sdk icon indicating copy to clipboard operation
dotnet-operator-sdk copied to clipboard

[bug]: Cannot specify the spec as being required

Open jamescooke-xyz opened this issue 7 months ago • 3 comments

Describe the bug

If I have required properties in my spec, adding the below will validate:

apiVersion: mycrd.io/v1
kind: MyResource
metadata:
  name: example
  namespace: default
spec: {}

But adding this will not:

apiVersion: mycrd.io/v1
kind: MyResource
metadata:
  name: example
  namespace: default
spec:

We need to be able to specify that the spec is required. Either by allowing us to overriding it and explicitly setting it as [Required], or by convention (if a child property is required).

To reproduce

Any CRD created using the Transpiler won't have the spec marked as required.

Expected behavior

An ability to mark the spec marked as required.

Screenshots

No response

Additional Context

No response

jamescooke-xyz avatar May 15 '25 09:05 jamescooke-xyz