- CPS-1016Getting issue details... STATUS
Assumptions/Decisions
# | Issue | Notes/Jira | Decision |
---|---|---|---|
1 | There are 2 separate query objects defined in OpenAPI | Combine them into one 'Conditions' has the better structure but 'cmHandleQueryRestParameters' is a better name | |
2 | Exact format of 'legacy' Conditions unclear and maybe not generic enough | Study demo: https://wiki.onap.org/download/attachments/93000392/CPS644.mkv?version=1&modificationDate=1636566033000&api=v2 | |
3 | Definition of 'Conditions' is not Generic enough | $ref: '#/components/schemas/ModuleNamesAsJsonArray Should be something like '#/components/ConditionParametersNameValuePairs | |
4 | Agree backward incompatibility | Discuss with stakeholders |
Implementation Proposal
Merge 2 'query' end points in one
# | Layer | Proposed Changes |
---|---|---|
1 | REST Layer |
|
2 | Controller Layer |
|
3 | Service Layer |
|
4 | Persistence Layer |
|
New Rest Request Input Format
Assumed Current Request Format:
See Issue #3, it need to be confirmed
{ "conditions": [ { "name": "hasAllModules", "conditionParameters": [ {"moduleName": "module1"} ,{ "moduleName": "module2" } } } ] }
Action 1: Rename query new top element name
After 'Merge' it should also support (public Properties conditions like so
{ "cmHandleQueryRestParameters": [ { "name": "hasAllModules", "conditionParameters": [ {"moduleName": "module1"} ,{ "moduleName": "module2" } ] } ] }
Action 2: Support (public' Properties condition using the same format
{ "cmHandleQueryRestParameters": [ { "name": "hasAllProperties", "conditionParameters": [ {"Colour": "Green"} ,{ "Size": "Small" } ] } ] }
Action 2: Verify combinations of conditions are supported (AND is assumed)
{ "cmHandleQueryRestParameters": [ { "name": "hasAllProperties", "conditionParameters": [ {"Colour": "Green"} ,{ "Size": "Small" } ] }, { "name": "hasAllModules", "conditionParameters": [ {"moduleName": "module1"} ,{ "moduleName": "module2" } }] } ] }
Test
- update existing tests to the new endpoint (groovy and CSIT)
- create new tests for new filtering scenarios (combine the two existing filter) in CSIT tests