Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up minor inconsistencies in cql2 schemas. #794

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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