Skip to content

Document _sortBy sorting support - #94

Merged
eviltester merged 1 commit into
masterfrom
codex/issue-89-sortby-docs
Jul 30, 2026
Merged

Document _sortBy sorting support#94
eviltester merged 1 commit into
masterfrom
codex/issue-89-sortby-docs

Conversation

@eviltester

Copy link
Copy Markdown
Owner

Summary

  • Rename the generated-doc sorting parameter to exact _sortBy.
  • Treat sortBy, sortby, and sort_by as ordinary filter field names again.
  • Add comma-separated multi-field sorting support.
  • Surface sorting and filter-condition behavior in generated HTML and OpenAPI docs.
  • Update sorting/docs tests and add direct sorter regression coverage.

Validation

  • Core query/repository targeted Maven tests
  • Generated docs/OpenAPI targeted Maven tests
  • Swaggerizer OpenAPI 3.2 test
  • Direct EntityInstanceListSorter unit tests
  • spotless:check
  • git diff --check

Copilot AI review requested due to automatic review settings July 30, 2026 15:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@eviltester
eviltester merged commit 437d7a4 into master Jul 30, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 128d592925

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"Some requests can be filtered by adding query params of fieldname=value. Where only matching items will be returned."));
output.append(
paragraph(
"Filter conditions can use <i>field=value</i> for equals, <i>field!=value</i> or <i>field!value</i> for not equals, <i>field&lt;value</i>, <i>field&gt;value</i>, <i>field&lt;=value</i>, and <i>field&gt;=value</i> for comparisons, <i>field~=regex</i> for regular expression matches, and <i>field*=wildcard</i> for wildcard matches where <i>*</i> matches many characters and <i>?</i> matches one character. Multiple query params are combined as AND conditions."));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Correct the claim that all filter parameters are ANDed

The AND guarantee is false when a regex or wildcard filter precedes another condition. EntityListFilterParamParser.matches returns immediately from its ~= and *= cases, so a request such as ?title*=Task*&status=false accepts an item as soon as its title matches without checking status. Either continue evaluating the remaining filters in those cases or qualify the generated documentation.

Useful? React with 👍 / 👎.

Comment on lines +437 to +439
Field primaryKeyField = filterableEntity.getPrimaryKeyField();
if (primaryKeyField != null) {
return primaryKeyField.getName();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid generating examples for unsortable primary keys

When the filterable entity has an AUTO_GUID primary key, this selects that field and generates an OpenAPI example such as _sortBy=+guid, but the in-memory sorter compares through ComparableFieldValue, which has no AUTO_GUID branch and therefore treats every GUID as equal. The documented example consequently leaves results unsorted in the in-memory repository while SQLite sorts them; either add GUID comparison support or choose/document only supported field types.

Useful? React with 👍 / 👎.

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.

2 participants