Skip to content
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

[feature]: JsonSchema.Net.Generation for openapi schema generation? #748

Open
SGStino opened this issue Apr 17, 2024 · 5 comments
Open

[feature]: JsonSchema.Net.Generation for openapi schema generation? #748

SGStino opened this issue Apr 17, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@SGStino
Copy link

SGStino commented Apr 17, 2024

Is your feature request related to a problem? Please describe.

Currently, the schema generation is limited to what is implemented,

Issues like #741, #396, #351 could possibly benefit from this

Describe the solution you would like

It would be nice to team up with a schema generator library and outsource those capabilities to generate the OpenApiV3 spec.

JsonSchema.Net offers JsonSchema with customizable keywords and validation on JsonNodes.
JsonSchema.Net.Generation can generate schemas from C# classes with reflection (for use in KubeOps.Cli?)

Additional Context

No response

@SGStino SGStino added the enhancement New feature or request label Apr 17, 2024
@buehler
Copy link
Owner

buehler commented Apr 18, 2024

Hey @SGStino

That's a good idea! As long as there are possibilities to add the special "x-kubernetes" attributes, we should be good to go. According to the docs of Kubernetes, they use openapi v3 and as such, we could use a lib for that.

@SGStino
Copy link
Author

SGStino commented Apr 19, 2024

The library supports adding custom vocabulary, so the x-kubernetes should be implemented as those.

I'll see if I can bash something together as reference so you can see how to fit it in the operator?

@buehler
Copy link
Owner

buehler commented Apr 19, 2024

That would be amazing! Thank you :-)

@SGStino
Copy link
Author

SGStino commented Apr 21, 2024

https://github.com/SGStino/JsonSchemaTest

If you have any real-life examples of entities we can test against?
Just to see what comes out, then we can figure out if anything works different or not at all.

@buehler
Copy link
Owner

buehler commented Apr 24, 2024

Hey @SGStino
Thanks :-)

Sadly - no. Since I made this SDK, I've only written one operator (weird, I know).

But maybe other contributors can provide some real world examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants