Combine JSON structure and Message Definition possibilities?
I created a Published REST service (json) with a GET method. Below the 2 possibilities for me: Possibility 1: Export mapping based on JSON structure Empty lists are still in the response Swagger documentation is available, except a response model or example response Possibility 2: Export mapping based on message definition Empty objects or empty lists are not in the response Swagger documentation is available, also with a response model and example response What I need: Empty lists and objects should be in the response Swagger documentation should have a response model and example response
Thank you Gerrit for answering.
I found the answer myself, because I missed a setting for “Show empty values” as null in the export mapping. Checking this setting includes also empty associations in the response. Also, the generated Swagger documentation contains a now beautiful response model and example response. In your message definition you can use custom entity and attribute names and examples values.
If you want to use swagger UI, then I would suggest to use possibility number 2. I am wondering why you don’t get a empty JSON list or empty JSON object.
Would it be possible for you to share your implementation to have a better understanding of your issue?