Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Generate OpenAPI Specs #243

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Commits on Dec 4, 2019

  1. Add code to generate openapi specs

    Some of the modern Kubernetes clients use clients generated from a
    swagger.json
    
    kubernetes-client/javascript uses kubernetes-client/gen which uses
    OpenApiTools/openapi-generator and kubernetes/kubernetes/api/openapi-spec/swagger.json
    
    There are open/closed/rotten/ignored issues all over the place about
    making these easier to use with CRDs.
    
    Wrongly closed issue on kubernetes-client/javascript: kubernetes-client/javascript#341
    Open issue on kubernetes-client/gen: kubernetes-client/gen#121
    
    It seems like kubernetes/kube-openapi is one of the repos working on
    solving the main part of this problem, generating the Go code to make
    it easy to generate a swagger.json
    
    I found the following Argo code via the following issue:
    
    kubernetes/kube-openapi#13
    
    https://github.com/argoproj/argo/blob/master/hack/gen-openapi-spec/main.go
    https://github.com/argoproj/argo/blob/master/pkg/apis/workflow/v1alpha1/openapi_generated.go#L14:6
    https://github.com/kubernetes/kube-openapi/blob/master/cmd/openapi-gen/openapi-gen.go
    
    So I'm working on adding similar stuff to Shipper.
    
    gen-openapi-spec uses the generated openapi_generated.go module that is
    generated via the openapi-gen command.
    
    The following commit adds the code to generate openapi_generated.go
    
    Signed-off-by: William Stewart <zoidbergwill@gmail.com>
    zoidyzoidzoid committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    95d39c3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6c37212 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    733876a View commit details
    Browse the repository at this point in the history
  4. Generated swagger.json

    Generated with:
    go run ./hack/gen-openapi-spec/main.go v1alpha1 > api/openapi-spec/swagger.json
    
    Signed-off-by: William Stewart <zoidbergwill@gmail.com>
    zoidyzoidzoid committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    0f3dfb9 View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2019

  1. Add missing fields/types from upstream

    Added these by hand, not 100% sure how to add them to generation.
    
    Signed-off-by: William Stewart <zoidbergwill@gmail.com>
    zoidyzoidzoid committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    16ff230 View commit details
    Browse the repository at this point in the history
  2. Whoops, forgot a type

    Signed-off-by: William Stewart <zoidbergwill@gmail.com>
    zoidyzoidzoid committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    a845e55 View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2019

  1. verify openapigen too

    zoidyzoidzoid committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    592c7e6 View commit details
    Browse the repository at this point in the history
  2. Fix deps

    Maybe this shouldn't go in the final PR that is merged.
    
    Also probably blocked by other 0.9 PR updating dependencies
    zoidyzoidzoid committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    2a79949 View commit details
    Browse the repository at this point in the history