How do I assign a label to the json object that is returned like "Test" in Test: { name: test1 }
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019
02:14 PM
01-29-2019
02:14 PM
How do I assign a label to the json object that is returned like "Test" in Test: { name: test1 }
I have a customer who is expecting the json objects in the response to contain a label like the following:
Test: {
name: test1
passed: false
}
I'm using Swagger 2.0. How do I assign "Test" to the object in the yaml file?
Labels:
- Labels:
-
Swagger UI
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019
03:06 PM
01-29-2019
03:06 PM
By defintion, you can't - that's not a valid JSON.
The most you can do is something like:
{ "Test": { "name": "test1", "passed": false } }
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019
03:14 PM
01-29-2019
03:14 PM
Actually that's what I think I want. How would you define that within the Swagger 2.0 components?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019
03:47 PM
01-29-2019
03:47 PM
Do you have anything as a starting point?
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
