Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ToProtoModels (0.28 sec)

  1. staging/src/k8s.io/apiserver/pkg/util/openapi/proto.go

    import (
    	"encoding/json"
    
    	openapi_v2 "github.com/google/gnostic-models/openapiv2"
    
    	"k8s.io/kube-openapi/pkg/util/proto"
    	"k8s.io/kube-openapi/pkg/validation/spec"
    )
    
    // ToProtoModels builds the proto formatted models from OpenAPI spec
    func ToProtoModels(openAPISpec *spec.Swagger) (proto.Models, error) {
    	specBytes, err := json.MarshalIndent(openAPISpec, " ", " ")
    	if err != nil {
    		return nil, err
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 02 14:34:26 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/util/openapi/proto_test.go

    						"version": "v1",
    						"kind":    "Foo",
    					},
    				},
    			},
    			Path: proto.NewPath("io.k8s.api.testgroup.v1.Foo"),
    		},
    	}
    	protoModels, err := ToProtoModels(openAPISpec)
    	if err != nil {
    		t.Fatalf("expected ToProtoModels not to return an error")
    	}
    	actualSchema := protoModels.LookupModel("io.k8s.api.testgroup.v1.Foo")
    	if !reflect.DeepEqual(expectedSchema, actualSchema) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 21 09:31:49 UTC 2021
    - 2.2K bytes
    - Viewed (0)
Back to top