-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Component: Framework/WebapiUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: dev in progressReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releaseTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject itfeature request
Description
Re-opening #7511 per comment #7511 (comment) as this affects 2.0 - 2.2 and hasn't been resolved.
Preconditions
- Magento 2 CE or EE (all versions)
Steps to reproduce
- View Magento-generated Swagger Specification
Expected result
- Search criteria described in format compatible with Open API / Swagger specification.
Actual result
- Format not described in a Swagger-compatible manner.
- Making searchCriteria-related requests using swagger-api/swagger-codegen clients produces an HTTP 400 response from Magento when request sent in described format.
The Magento dev docs correctly describe REST API search criteria field groups and filters usage as needing an index per-field group / filter:
searchCriteria[filter_groups][<index>][filters][<index>][field=<field_name>]
searchCriteria[filter_groups][<index>][filters][<index>][value=<search_value>]
searchCriteria[filter_groups][<index>][filters][<index>][condition_type=<operator>]
When viewing the generated Swagger documentation, search criteria is described as follows (without a numerical index):
searchCriteria[filterGroups][][filters][][field]
Sending a request using searchCriteria
in the format described by schema.json (without the numerical index) produces an HTTP 400 response. It also does not allow a user to define more than one filterGroup
or filter
, and breaks swagger-codegen clients.
The searchCriteria
implementation doesn't appear to be compatible with the Open API Specification in the current format.
Possible solutions
- Provide Swagger code-gen templates to workaround the spec
- Implement a searchCriteria builder endpoint to accept a searchCritera
POST
body and reply with the query string. - Change searchCriteria implementation
dmanners, Sharkozp, springimport, TomashKhamlai, DavidLambauer and 3 more
Metadata
Metadata
Assignees
Labels
Component: Framework/WebapiUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: dev in progressReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releaseTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject itfeature request
Type
Projects
Status
In Progress