Skip to content

CRDGenerator: JSON Schema annotation for full control #6999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MikeEdgar opened this issue Apr 10, 2025 · 0 comments · May be fixed by #7000
Open

CRDGenerator: JSON Schema annotation for full control #6999

MikeEdgar opened this issue Apr 10, 2025 · 0 comments · May be fixed by #7000
Assignees
Labels
component/crd-generator Related to the CRD generator

Comments

@MikeEdgar
Copy link
Contributor

Is your enhancement related to a problem? Please describe

There are a number of JSON schema properties that we are not able to represent with the code-first approach. Several issues are open in this repository to individually add support for things like oneOf schema assertions or particular Kubernetes extensions like x-kubernetes-list-type.

Describe the solution you'd like

I'd like to propose introducing an annotation @JSONSchema that maps directly to io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps. When present, this annotation would be used instead of any other processing/introspection for an element (class, field, method). This would work similar to how Swagger or MicroProfile OpenAPI schema annotations work, giving full control to the user. Since Java annotations cannot be recursive, any nested schema references (e.g. anyOf) would have a type of Class, pointing to the type which would be further scanned to fill in that schema's information.

Describe alternatives you've considered

No response

Additional context

No response

@MikeEdgar MikeEdgar linked a pull request Apr 10, 2025 that will close this issue
11 tasks
@manusa manusa added the component/crd-generator Related to the CRD generator label Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/crd-generator Related to the CRD generator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants