From d5c8fa61b65a1d67346e6cfb7edfbe821b576cd5 Mon Sep 17 00:00:00 2001 From: Matthew White Date: Tue, 3 Oct 2023 15:33:41 -0400 Subject: [PATCH] Clarify that OData operator for "not equals" is ne, not neq (#1019) --- docs/api.yaml | 14 +++++++------- test/unit/data/odata-filter.js | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/api.yaml b/docs/api.yaml index 22638604f..aec835843 100644 --- a/docs/api.yaml +++ b/docs/api.yaml @@ -7745,7 +7745,7 @@ paths: in: query description: If provided, will filter responses to those matching the given OData query. Only [certain fields](/central-api-odata-endpoints/#data-document) - are available to reference. The operators `lt`, `le`, `eq`, `neq`, `ge`, + are available to reference. The operators `lt`, `le`, `eq`, `ne`, `ge`, `gt`, `not`, `and`, and `or` are supported, and the built-in functions `now`, `year`, `month`, `day`, `hour`, `minute`, `second`. schema: @@ -7859,7 +7859,7 @@ paths: in: query description: If provided, will filter responses to those matching the given OData query. Only [certain fields](/central-api-odata-endpoints/#data-document) - are available to reference. The operators `lt`, `le`, `eq`, `neq`, `ge`, + are available to reference. The operators `lt`, `le`, `eq`, `ne`, `ge`, `gt`, `not`, `and`, and `or` are supported, and the built-in functions `now`, `year`, `month`, `day`, `hour`, `minute`, `second`. schema: @@ -7970,7 +7970,7 @@ paths: in: query description: If provided, will filter responses to those matching the given OData query. Only [certain fields](/central-api-odata-endpoints/#data-document) - are available to reference. The operators `lt`, `le`, `eq`, `neq`, `ge`, + are available to reference. The operators `lt`, `le`, `eq`, `ne`, `ge`, `gt`, `not`, `and`, and `or` are supported, and the built-in functions `now`, `year`, `month`, `day`, `hour`, `minute`, `second`. schema: @@ -8050,7 +8050,7 @@ paths: in: query description: If provided, will filter responses to those matching the given OData query. Only [certain fields](/central-api-odata-endpoints/#data-document) - are available to reference. The operators `lt`, `le`, `eq`, `neq`, `ge`, + are available to reference. The operators `lt`, `le`, `eq`, `ne`, `ge`, `gt`, `not`, `and`, and `or` are supported, and the built-in functions `now`, `year`, `month`, `day`, `hour`, `minute`, `second`. schema: @@ -12189,7 +12189,7 @@ paths: in: query description: If provided, will filter responses to those matching the query. Only [certain fields](/central-api-odata-endpoints/#data-document) - are available to reference. The operators `lt`, `le`, `eq`, `neq`, `ge`, + are available to reference. The operators `lt`, `le`, `eq`, `ne`, `ge`, `gt`, `not`, `and`, and `or` are supported, and the built-in functions `now`, `year`, `month`, `day`, `hour`, `minute`, `second`. schema: @@ -12658,7 +12658,7 @@ paths: in: query description: If provided, will filter responses to those matching the query. Only [certain fields](/central-api-odata-endpoints/#data-document) - are available to reference. The operators `lt`, `le`, `eq`, `neq`, `ge`, + are available to reference. The operators `lt`, `le`, `eq`, `ne`, `ge`, `gt`, `not`, `and`, and `or` are supported, and the built-in functions `now`, `year`, `month`, `day`, `hour`, `minute`, `second`. schema: @@ -13107,7 +13107,7 @@ paths: in: query description: If provided, will filter responses to those matching the query. Only [certain fields](/central-api-odata-endpoints/#data-document) - are available to reference. The operators `lt`, `le`, `eq`, `neq`, `ge`, + are available to reference. The operators `lt`, `le`, `eq`, `ne`, `ge`, `gt`, `not`, `and`, and `or` are supported, and the built-in functions `now`, `year`, `month`, `day`, `hour`, `minute`, `second`. schema: diff --git a/test/unit/data/odata-filter.js b/test/unit/data/odata-filter.js index edcfe0bf5..de68defaf 100644 --- a/test/unit/data/odata-filter.js +++ b/test/unit/data/odata-filter.js @@ -18,6 +18,7 @@ const odataFilter = (exp) => _odataFilter(exp, odataToColumnMap); describe('OData filter query transformer', () => { it('should transform binary expressions', () => { odataFilter('3 eq 5').should.eql(sql`(${'3'} is not distinct from ${'5'})`); + odataFilter('3 ne 5').should.eql(sql`(${'3'} is distinct from ${'5'})`); odataFilter('2 lt 3 and 5 gt 4').should.eql(sql`((${'2'} < ${'3'}) and (${'5'} > ${'4'}))`); odataFilter('3 eq __system/submitterId').should.eql(sql`(${'3'} is not distinct from ${sql.identifier([ 'submissions', 'submitterId' ])})`); odataFilter('2 eq $root/Submissions/__system/submitterId').should.eql(sql`(${'2'} is not distinct from ${sql.identifier([ 'submissions', 'submitterId' ])})`);