From 4ca4c848967d599fb09c05db5d7bac208e4c80a3 Mon Sep 17 00:00:00 2001 From: Roger Peppe Date: Mon, 9 Sep 2024 14:45:02 +0100 Subject: [PATCH] encoding/jsonsschema: use openAPI not vset(VersionOpenAPI) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is equivalent and slightly more concise (and it's also good to be consistent with the other places an openAPI version is used). Signed-off-by: Roger Peppe Change-Id: I69eff1310409e465eac03da3409030918e4e4908 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200897 Unity-Result: CUE porcuepine Reviewed-by: Daniel Martí TryBot-Result: CUEcueckoo --- encoding/jsonschema/constraints.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/encoding/jsonschema/constraints.go b/encoding/jsonschema/constraints.go index 871beeeb425..e08ee04c032 100644 --- a/encoding/jsonschema/constraints.go +++ b/encoding/jsonschema/constraints.go @@ -89,14 +89,14 @@ var constraints = []*constraint{ p1("dependentSchemas", constraintTODO, vfrom(VersionDraft2019_09)), p2("deprecated", constraintDeprecated, vfrom(VersionDraft2019_09)|openAPI), p2("description", constraintDescription, allVersions|openAPI), - p1("discriminator", constraintTODO, vset(VersionOpenAPI)), + p1("discriminator", constraintTODO, openAPI), p1("else", constraintTODO, vfrom(VersionDraft7)), p2("enum", constraintEnum, allVersions|openAPI), - p1("example", constraintTODO, vset(VersionOpenAPI)), + p1("example", constraintTODO, openAPI), p2("examples", constraintExamples, vfrom(VersionDraft6)), p2("exclusiveMaximum", constraintExclusiveMaximum, allVersions|openAPI), p2("exclusiveMinimum", constraintExclusiveMinimum, allVersions|openAPI), - p1("externalDocs", constraintTODO, vset(VersionOpenAPI)), + p1("externalDocs", constraintTODO, openAPI), p1("format", constraintTODO, allVersions|openAPI), p1("id", constraintID, vto(VersionDraft4)), p1("if", constraintTODO, vfrom(VersionDraft7)), @@ -113,7 +113,7 @@ var constraints = []*constraint{ p3("minimum", constraintMinimum, allVersions|openAPI), p2("multipleOf", constraintMultipleOf, allVersions|openAPI), p3("not", constraintNot, allVersions|openAPI), - p2("nullable", constraintNullable, vset(VersionOpenAPI)), + p2("nullable", constraintNullable, openAPI), p3("oneOf", constraintOneOf, allVersions|openAPI), p2("pattern", constraintPattern, allVersions|openAPI), p3("patternProperties", constraintPatternProperties, allVersions), @@ -129,7 +129,7 @@ var constraints = []*constraint{ p1("unevaluatedProperties", constraintTODO, vfrom(VersionDraft2019_09)), p2("uniqueItems", constraintUniqueItems, allVersions|openAPI), p1("writeOnly", constraintTODO, vfrom(VersionDraft7)|openAPI), - p1("xml", constraintTODO, vset(VersionOpenAPI)), + p1("xml", constraintTODO, openAPI), } func p0(name string, f constraintFunc, versions versionSet) *constraint {