Clean up minor inconsistencies in cql2 schemas. #794
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While writing a parser I have spent a lot of time switching back and forth between the schema formats leading me to notice a few inconsistencies between the different formats so I have attempted to address them. I tried not to do anything dramatic, just align everything together a little better.
The biggest issue I have had is
%
anddiv
only existing in the cql2.bnf file, but there were lots of other little things that added up. I have attempted to provide detailed justifications for everything below.Both cql2.json and cql2.yaml
%
anddiv
to arithmetic op enums.cql2.json
prefixItems
toitems
when it was used for objects of the same type.additionalItems
withminItems
andmaxItems
.prefixItems
does not require all items in the array to exist. So,minItems
is needed to require all of them.additionalItems
so it seemed better to remove and be forward compatible.arrayLiteral
->arrayExpression
.Expressions
in both the json and yaml so I figured this would be the one to adjust.Literal
(orInstance
per Change names of some "literal" production because they are not stricly literals. #790) types and addingfunction
andproperty
directly would better align to the bnf file and feels easier to read. But I did not want to do that without discussion. This would also apply to various other locations where similar things are done as well.cql2.yaml
prefixItems
todescription
within the yaml.prefixItems
and no longer need these comments. I figured that would need additional discussion though.patternExpression
toisLikeOperands
.characterExpression
this aligns with the json better, and makes the description more useful.prefixItems
if an OpenAPI 3.1 upgrade happened.minItems
andmaxItems
toinListOperands
.