update dependencies

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-12-22 16:48:26 +08:00
parent 4a11a50544
commit fe6c5de00f
2857 changed files with 252134 additions and 115656 deletions

View File

@@ -73,6 +73,20 @@ type Parser struct {
packages map[*loader.Package]struct{}
flattener *Flattener
// AllowDangerousTypes controls the handling of non-recommended types such as float. If
// false (the default), these types are not supported.
// There is a continuum here:
// 1. Types that are always supported.
// 2. Types that are allowed by default, but not recommended (warning emitted when they are encountered as per PR #443).
// Possibly they are allowed by default for historical reasons and may even be "on their way out" at some point in the future.
// 3. Types that are not allowed by default, not recommended, but there are some legitimate reasons to need them in certain corner cases.
// Possibly these types should also emit a warning as per PR #443 even when they are "switched on" (an integration point between
// this feature and #443 if desired). This is the category that this flag deals with.
// 4. Types that are not allowed and will not be allowed, possibly because it just "doesn't make sense" or possibly
// because the implementation is too difficult/clunky to promote them to category 3.
// TODO: Should we have a more formal mechanism for putting "type patterns" in each of the above categories?
AllowDangerousTypes bool
}
func (p *Parser) init() {
@@ -162,7 +176,7 @@ func (p *Parser) NeedSchemaFor(typ TypeIdent) {
// avoid tripping recursive schemata, like ManagedFields, by adding an empty WIP schema
p.Schemata[typ] = apiext.JSONSchemaProps{}
schemaCtx := newSchemaContext(typ.Package, p)
schemaCtx := newSchemaContext(typ.Package, p, p.AllowDangerousTypes)
ctxForInfo := schemaCtx.ForInfo(info)
pkgMarkers, err := markers.PackageMarkers(p.Collector, typ.Package)