In stub mapping files, where only a single request-response mapping is defined within the mappings property can be simplified by unwrapping the mapping and removing the mappings property.
Tasks
Create an inspection that can detect mappings properties with a single request-response mapping.
What about cases when the children look like this: request-response, response, request, none?
Add quick fix to remove the mappings property like this:
- Make sure to keep any other properties specified.
- In case there is a `meta` property specified as well, besides `mappings`, don't report anything, because the meta might contain important properties that can be lost if users are not cautious enough when using the quick fix.
## To be clarified
- Look into other properties if they need special care.
Summary
In stub mapping files, where only a single request-response mapping is defined within the
mappings
property can be simplified by unwrapping the mapping and removing themappings
property.Tasks
mappings
properties with a single request-response mapping.mappings
property like this://to { "request": { ... }, "response" : { ... } }