cuelang / cue

CUE has moved to https://github.com/cue-lang/cue
https://cuelang.org
Apache License 2.0
3.09k stars 171 forks source link

support disabling field validation by inserting object in to openapi schema #1059

Closed ilackarms closed 3 years ago

ilackarms commented 3 years ago

the purpose of this change is to enable the use of recursive fields with Cue reference expansion.

we disable the fields


import "encoding/protobuf/cue/cue.proto";

message RecursiveMessage {
  RecursiveMessage message = 1 [(cue.opt).disable_openapi_validation = true];
  repeated RecursiveMessage messages = 2 [(cue.opt).disable_openapi_validation = true];
}

this will yield an openapi schema which treats these fields as having the generic object type. additional work is needed to support unstrucutred fields, which is the addition of x-kubernetes-preserve-unknown-fields: true property to openapi schema for the proto fields which supply this option.

ilackarms commented 3 years ago

working on a different solution to support the x-kubernetes-preserve-unknown-fields option