Skip to content

Commit

Permalink
Merge pull request #794 from eseglem/feature/cleanup-inconsistency
Browse files Browse the repository at this point in the history
Clean up minor inconsistencies in cql2 schemas.

Meeting 2023-05-08: Decision to merge.
  • Loading branch information
cportele authored May 8, 2023
2 parents b36899e + ded2bee commit cd87451
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 49 deletions.
67 changes: 28 additions & 39 deletions cql2/standard/schema/cql2.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,9 @@
"type": "array",
"minItems": 2,
"maxItems": 2,
"prefixItems": [
{
"$ref": "#/$defs/scalarExpression"
},
{
"$ref": "#/$defs/scalarExpression"
}
]
"items": {
"$ref": "#/$defs/scalarExpression"
}
},

"scalarExpression": {
Expand Down Expand Up @@ -159,16 +154,17 @@
}
},
"isLikeOperands": {
"type": "array",
"prefixItems": [
{
"$ref": "#/$defs/characterExpression"
},
{
"$ref": "#/$defs/patternExpression"
}
],
"additionalItems": false
"type": "array",
"minItems": 2,
"maxItems": 2,
"prefixItems": [
{
"$ref": "#/$defs/characterExpression"
},
{
"$ref": "#/$defs/patternExpression"
}
]
},

"patternExpression": {
Expand Down Expand Up @@ -251,6 +247,8 @@
},
"inListOperands": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"prefixItems": [
{
"$ref": "#/$defs/scalarExpression"
Expand All @@ -261,8 +259,7 @@
"$ref": "#/$defs/scalarExpression"
}
}
],
"additionalItems": false
]
},

"isNullPredicate": {
Expand Down Expand Up @@ -322,15 +319,11 @@
},
"spatialOperands": {
"type": "array",
"prefixItems": [
{
"$ref": "#/$defs/geomExpression"
},
{
"$ref": "#/$defs/geomExpression"
}
],
"additionalItems": false
"minItems": 2,
"maxItems": 2,
"items": {
"$ref": "#/$defs/geomExpression"
}
},
"geomExpression": {
"oneOf": [
Expand Down Expand Up @@ -377,15 +370,11 @@
},
"temporalOperands": {
"type": "array",
"prefixItems": [
{
"$ref": "#/$defs/temporalExpression"
},
{
"$ref": "#/$defs/temporalExpression"
}
],
"additionalItems": false
"minItems": 2,
"maxItems": 2,
"items": {
"$ref": "#/$defs/temporalExpression"
}
},
"temporalExpression": {
"oneOf": [
Expand Down Expand Up @@ -469,7 +458,7 @@
"properties": {
"op": {
"type": "string",
"enum": [ "+", "-", "*", "/", "^" ]
"enum": [ "+", "-", "*", "/", "^", "%", "div" ]
},
"args": {
"$ref": "#/$defs/arithmeticOperands"
Expand Down
29 changes: 19 additions & 10 deletions cql2/standard/schema/cql2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ components:
op:
type: string
enum:
- =
- <
- >
- '='
- '<>'
- '<'
- '>'
- '<='
- '>='
- <>
args:
$ref: '#/components/schemas/scalarOperands'
scalarOperands:
Expand Down Expand Up @@ -108,9 +108,12 @@ components:
minItems: 2
maxItems: 2
items:
# The second argument is a string or a CASEI or
# ACCENTI call with a str.
$ref: '#/components/schemas/characterExpression'
oneOf:
- $ref: '#/components/schemas/characterExpression'
- $ref: '#/components/schemas/patternExpression'
description: >-
The first argument is a characterExpression and the second item
is a patternExpression.
patternExpression:
oneOf:
- type: object
Expand Down Expand Up @@ -164,13 +167,17 @@ components:
$ref: '#/components/schemas/inListOperands'
inListOperands:
type: array
minItems: 2
maxItems: 2
items:
# the first item is always a scalarExpression, the second an array
oneOf:
- $ref: '#/components/schemas/scalarExpression'
- type: array
items:
$ref: '#/components/schemas/scalarExpression'
description: >-
The first item is a scalarExpression and the second item is an array
of scalarExpression.
isNullPredicate:
type: object
required:
Expand Down Expand Up @@ -300,11 +307,13 @@ components:
op:
type: string
enum:
- +
- '+'
- '-'
- '*'
- /
- '/'
- '^'
- '%'
- 'div'
args:
$ref: '#/components/schemas/arithmeticOperands'
arithmeticOperands:
Expand Down

0 comments on commit cd87451

Please sign in to comment.