Add custom 'Example Value' in the Rest API 'Request body'
See original GitHub issueDescription
The Request body
sections in the REST API endpoints below can be improved with a custom Example Value
plugins
parameter in run_plugins
endpoint
args
parameter in run_plugin
endpoint
data
parameter in add_recordstore
endpoint
Steps to Reproduce
- Open Swagger (Run constellation and
Tools
->Start Rest Server
thenthen Display Rest Server Documentation
) - Check above endpoints
Expected behaviour:
Custom Example Value
s displayed in the Request Body
Actual behaviour:
Example Value
is empty:
Reproduces how often: 100%
Additional Information
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top Results From Across the Web
java - How to Customise example value of request body and ...
Using @Schema annotation, I can provide the value in example request. Public class Student{ @Schema(example= "XXX", description = "Name of ...
Read more >Adding Examples - Swagger
For example, an API mocking tool can use sample values to generate mock requests. ... Here is an example of the example keyword...
Read more >Add a Request Body to a POST Request | API Connector
Enter a Request Body As part of a POST , PUT , or PATCH request, a data payload can be sent to the...
Read more >How can I create custom HTTP body
How can I send the body to HTTP POST method request? I understand that setBody accepts only string argument and I need to...
Read more >Setting Example and Description with Swagger - Baeldung
To create a REST API from scratch, we can follow this tutorial from Spring Docs to create a RESTful web service using Spring...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @Auriga2 I’ve been reading along though didn’t respond yet.
OK with hard coding the values for the 3 endpoints. That will be of great help. OK with your examples.
Yes this will definitely help and worth making a different ticket. Might as well link this ticket to it too.
Regarding the presentation of the responses in Swagger based on the images above I like the how they are formatted. The blue background is for GET’s and green is for POST’s so it depends based on the endpoint.
I think the authorize button is cool. If that can be put in once and then referenced in all the endpoints without having to put it in each time that would be great.
Please feel free to make another ticket with your ideas if you don’t want to get them done in this one.
Anyway looking forward to reviewing the PR when you’re ready.
That explains where the tick came from. I think it is best to keep it. Thanks for getting back to me @Auriga2 so fast! Very speedy.