Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ExampleRequestBody to to used like @Example for response #1107

Open
2 of 4 tasks
WORMSS opened this issue Oct 8, 2021 · 5 comments
Open
2 of 4 tasks

@ExampleRequestBody to to used like @Example for response #1107

WORMSS opened this issue Oct 8, 2021 · 5 comments

Comments

@WORMSS
Copy link

WORMSS commented Oct 8, 2021

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

@WoH WoH added the help wanted label Nov 1, 2021
@mrattner
Copy link

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

@WORMSS
Copy link
Author

WORMSS commented Feb 23, 2022

Nope, not even close.

@sjerratsch
Copy link

for me it seems to work, if the example is written all in the same line
e.g.
@example body { "features": [ { "geometry": { "coordinates": [ [ [ 0 ] ] ], "type": "Polygon" }, "properties": { "value": 0 }, "type": "Feature" } ], "type": "FeatureCollection" }
works,

@example body {
"features": [
{
"geometry":
{
"coordinates":
[ 
[ 
[ 
0
]
]
], 
"type": "Polygon"
}, 
"properties": { 
"value": 0 
}, 
"type": "Feature" 
} 
], 
"type": "FeatureCollection" 
}

does not

@slavistan
Copy link

@WORMSS I think you should remove the two empty checkboxes. These seem to generate that progress indicator which says that two of four tasks have been finished. This suggests that this issue is actively being worked on while it is not, judging from the activity in this thread.

@WORMSS
Copy link
Author

WORMSS commented Dec 16, 2022

@slavistan once you have changed the text in .github/ folder, I would be happy too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants