- CPS-679Getting issue details... STATUS - CPS-678Getting issue details... STATUS
Open Issues | |
---|---|
1 | Which option to choose from the below solutions? |
2 | For solution no.1, should fields be a known parameter and queries can be an unknown parameter? |
Description of the bug
Currently, NCMP does NOT support / slashes in the resource identifier as the OpenAPI definition would regard that as separate REST paths ie. a different rest endpoint
Slashes are currently not supported by open API for path params - https://github.com/OAI/OpenAPI-Specification/issues/892#issuecomment-281170254
Currently supported
/v1/ch/node1/data/ds/ncmp-datastore:passthrough-operational/turing-machine:turing-machine?fields=transition-function?depth=3
Wanted (currently not) supported
/v1/ch/node1/data/ds/ncmp-datastore:passthrough-operational/turing-machine:turing-machine/transition-function?depth=5
Solutions
Description | Example | Pros & Cons | |
---|---|---|---|
1 | Change resource Identifier from a path param to a query param in the openapi.yml | resource identifier will be mandatory | Pros Does not have a single resource path |
2 |
|
| |
3 | Create a method in the controller without using open API | @RequestMapping(value = "/v1/ch/{cmHandle}/data/ds/ncmp-datastore:passthrough-running/**", produces = {"application/json"}, consumes = {"application/json"}, method = RequestMethod.PUT) public ResponseEntity<Object> getResourceDataPassthroughRunningForCmHandle( @PathVariable("cmHandle") String cmHandle, HttpServletRequest resourceIdentifier ,@RequestBody DataAccessReadRequest body, @RequestHeader(value = "accept", required = false) String accept ,@RequestParam(value = "fields", required = false) String fields , @Min(1) @Valid @RequestParam(value = "depth", required = false) Integer depth ) { final var modulesListAsJson = dmiService.getResourceDataPassThroughRunningForCmHandle(cmHandle, resourceIdentifier.toString(), accept, fields, depth, body.getCmHandleProperties()); return ResponseEntity.ok(modulesListAsJson); } | Pros We may need to use this approach for other methods. Does not change the url Cons Does not use open API |