Skip to content

Enable $compute allowed settings - #735

Merged
xuzhg merged 1 commit into
mainfrom
issue730
Nov 17, 2022
Merged

Enable $compute allowed settings#735
xuzhg merged 1 commit into
mainfrom
issue730

Conversation

@xuzhg

@xuzhg xuzhg commented Nov 1, 2022

Copy link
Copy Markdown
Member

issue #730

Enable to validate $compute if AllowedQueryOptions has correct setting.

ValidateQueryOptionAllowed(AllowedQueryOptions.Compute, validationSettings.AllowedQueryOptions);
}
ValidateQueryOptionAllowed(AllowedQueryOptions.Compute, validationSettings.AllowedQueryOptions);
options.Compute.Validate(validationSettings);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change leads to not parsing the ComputeClause during this validation. Is that desirable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, in ODataQueryValidator, we validate whether the query option is allowed or not.
In each Query validator, for example FilterQueryValidator, ComputeQueryValidator, we valid the content.

For $compute clause, what expect error message do you want to get if the $compute clause is not valid?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that is the way, other validators work as well, than that is fine with me.
If the ComputeQueryValidator will parse the string and returns error message when the expression is incorrect, than that would be good enough for me, just like the filter errors.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will merge this PR and Let me try adding the expression validation in another PR.

@KenitoInc KenitoInc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calling endpoint with $compute when Compute is not allowed in settings, still parses the whole expression

3 participants