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.

@ExampleRequestBody to to used like @Example for response

See original GitHub issue

Sorting

  • I’m submitting a …

    • bug report
    • feature request
    • support request
  • I confirm that I

    • used the search to make sure that a similar issue hasn’t already been submit

Expected Behavior

@ExampleRquestBody<MyEndpointRequestBody>({
  "type": "a",
  "aProp": false
})
@ExampleRquestBody<MyEndpointRequestBody>({
  "type": "b",
  "bProp": true
})
@ExampleRquestBody<MyEndpointRequestBody>({
  "type": "c",
  "cProp": false
})
@Post('my-endpoint')
public async myEndpint(
  @Body() body: MyEndpointRequestBody,
  @Request() request: Request,
).... blar blar blar

Current Behavior

not possible to add example requests, only on response. which isn’t helpful here.

Possible Solution

see expected

Steps to Reproduce

n/a

Context (Environment)

n/a

Detailed Description

@ExampleRequestBody to to used like @Example for response

Breaking change?

n/a

#180 requests this, and then after much confusion, it was closed, and asked to make a new issue, and as far as I can tell, it was never created… so I have added it now…

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

1reaction
WORMSScommented, Feb 23, 2022

Nope, not even close.

1reaction
mrattnercommented, Feb 23, 2022

The combination of @param and @example jsdoc tags already covers this use case, yes? As described in this comment on #180

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring's RequestBody and ResponseBody Annotations
In this quick tutorial, we provide a concise overview of the Spring @RequestBody and @ResponseBody annotations.
Read more >
Describing Request Body - Swagger
Request bodies are typically used with “create” and “update” operations (POST, PUT, PATCH). For example, when creating a resource using POST or PUT,...
Read more >
Specifying examples - Postman Learning Center
Each example includes a request part (method, URL, parameters, headers, and body) and a response part (status code, body, and headers). You ...
Read more >
HTTP GET with request body - Stack Overflow
When doing a GET on certain entities, clients can request the contents of the entity. If they want to add some parameters (for...
Read more >
Add a Request Body to a POST Request | API Connector
This article describes how to add a request body to a POST , PUT , or PATCH request using the API Connector extension...
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