encoding/openapi: implement strict mode
There is currently no way to import OpenAPI schemas in strict mode, by
contrast with JSON Schema.
This addresses that shortcoming. We also make strict mode the default,
and make the OpenAPI 3.0 implementation always use strict keywords mode,
as that spec explicitly prohibits other fields, unlike JSON Schema.
We support the `strict` filetype for OpenAPI to mirror that for
`jsonschema`, but we don't need to add a corresponding field to
`encoding/openapi.Config` - it's nicer to have orthogonal configuration
fields.
Fixes #3445.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Ie703b4f294ce7ef68dee3abd5fd2f4bf952e14b8
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201113
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>