Skip to content

API Explorer ignores filter options where, fields, and order #2208

@ewrayjohnson

Description

@ewrayjohnson

I am using the example Todo model with the memory connector. The GET/ operations show the following example filter object, but "where", "fields", and "order "o are stripped before getting to the controller's find method.

{
  "where": {},
  "fields": {},
  "offset": 0,
  "limit": 0,
  "skip": 0,
  "order": [
    "string"
  ]
}

From other posts, this may be a coercion issue, but I would expect this functionality from LB3 to work flawlessly in LB4. I strongly disagree with the announcement that "...LoopBack 4 GA is Now Ready for Production Use!" Also, I cannot find ANY documentation on filters in the LB4 documentation. My test filter is as simple as:

{
  "where": {
        "id" : 1
   } 
}

Acceptance Criteria:

  • - this is a breaking fix, needs semver major release
  • - change existing param.query.object decorator to support json objects in query params.
    including content field in param spec, helps to support both exploded filter conditions like filter[limit] = 0 and json objects as per spike PR feat: spike on API Explorer supporting complex objects in query param #4141
  • - parameter schema cannot have content field along with schema, explode, type fields. swagger validation fails (check with https://editor.swagger.io/) if they appear together.
  • - loopback currently does not support extracting parameter schema from the content field. if we are including schema under content and not schema field, then it means additional changes in tests and source.
  • - add additional unit, acceptance and regression tests
  • - add documentation for filter conditions and above changes
  • - Close related stories

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions