Skip to content

Commit

Permalink
encoding/jsonsschema: use openAPI not vset(VersionOpenAPI)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Change-Id: I69eff1310409e465eac03da3409030918e4e4908
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200897
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
rogpeppe committed Sep 10, 2024
1 parent 6341362 commit 4ca4c84
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions encoding/jsonschema/constraints.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand All @@ -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),
Expand All @@ -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 {
Expand Down

0 comments on commit 4ca4c84

Please sign in to comment.