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

Operators gt, lt etc to enums too, that means that we are allowing to compare strings with lt, gt.... that not make sense #103

Closed
RubenBG7 opened this issue Nov 27, 2023 · 1 comment · Fixed by #132
Assignees
Labels
correction correction in documentation

Comments

@RubenBG7
Copy link
Collaborator

If we read the API guidelines designed, we are applying operators gt, lt etc to enums too, that means that we are allowing to compare strings with lt, gt.... that not make sense.

In adition we are not allowing with the actual guidelines to compare a value that is exactly that value , we have not defined the equals operator. Then my proposal is basing on the TMF 630 use:

image

For numeric and dates value allow:

.gt > / .gte >= / .lt < / .lte <= / .eq = / .neq !=

And for string enums:

.eq = / .neq !=

@RubenBG7 RubenBG7 added the correction correction in documentation label Nov 27, 2023
rartych added a commit that referenced this issue Dec 6, 2023
Filtering GET results - update section 8.3 in API DG 
Merging as agreed further changes shall be discussed in issues: #103 #98 #97
@eric-murray
Copy link
Collaborator

The filtering examples already allow the = operator to be used to test equality for text (i.e. strings, whether enumerated or not), numbers and dates:

Operation Text Numbers Dates
Equal GET .../?name=Juan GET .../?amount=807.24 GET .../?executionDate=2018-30-05

The question is whether the inequality operators (gte|gt|lte|lt) make sense for enumerated strings, which is currently allowed.

I had assumed this would be applied in the same way that programming languages treat enumerated types. So for enum: [ three, two, one ], then one is greater than two, which is greater than three. But this was just an assumption on my part, and certainly it could do with clarification, or the removal of the option to use inequality operators with enumerated types if this is not useful.

I have no problem with introducing a "not equals" operator (!= or .neq) or the additional equality operator .eq if these would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
correction correction in documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants