Giter Site home page Giter Site logo

Working example about kube-openapi HOT 7 CLOSED

devdattakulkarni avatar devdattakulkarni commented on September 17, 2024 1
Working example

from kube-openapi.

Comments (7)

devdattakulkarni avatar devdattakulkarni commented on September 17, 2024 1

@dailong If you add // +k8s:openapi-gen=true on your Type definition then you should be able to generate OpenAPI Spec for your Type. If there is any validation error then fix your Type definition and try again. The error that I have ran into typically is the name validation error. This means that in the type definition there is some problem with how names are defined in the type spec or the type status definition. The main issue for me has been when field name defined in the Go code and field name expected as json have been different. kube-openapi name validation rules expect the field name in Go code and field name in json to be exactly same with just the first letter in different case (Go code requires CamelCase, json requires camelCase). So keep an eye out for such an issue in your type definition.

Another issue that I have ran into is that kube-openapi doesn't seem to understand ObjectMeta and ListMeta types.

I have put together a small utility to make it easy to generate OpenAPI Spec for custom Types. You can find it here:
https://github.com/cloud-ark/kubeplus/tree/master/openapi-spec-generator

The driver script works on a copy of your types.go. It comments out lines containing ObjectMeta and ListMeta and then runs this modified types.go through kube-openapi.
README gives the steps that you can follow to generate OpenAPI Spec for your type. Hopefully it helps.

from kube-openapi.

dailong avatar dailong commented on September 17, 2024

I have this problem too. How did you solve it?

from kube-openapi.

dailong avatar dailong commented on September 17, 2024

I got it. thanks

from kube-openapi.

fejta-bot avatar fejta-bot commented on September 17, 2024

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

from kube-openapi.

fejta-bot avatar fejta-bot commented on September 17, 2024

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

from kube-openapi.

fejta-bot avatar fejta-bot commented on September 17, 2024

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

from kube-openapi.

k8s-ci-robot avatar k8s-ci-robot commented on September 17, 2024

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from kube-openapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.