question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add custom 'Example Value' in the Rest API 'Request body'

See original GitHub issue

Description

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

  1. Open Swagger (Run constellation and Tools->Start Rest Server thenthen Display Rest Server Documentation)
  2. Check above endpoints

Expected behaviour: Custom Example Values displayed in the Request Body

Actual behaviour: Example Value is empty: image

Reproduces how often: 100%

Additional Information

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
arcturus2commented, Sep 24, 2021

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.

It’d be nice to have Example Value added in all the Responses as well, (if it’s worth the effort because someone has to go through all the plugins and determine this), probably in a different ticket.

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.

0reactions
GammaVelcommented, Oct 1, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found