Skip to content

Commit 68f18a1

Browse files
committed
Merge branch 'release/swagger-2.0.0' into dev
2 parents 91a020d + 97f0a02 commit 68f18a1

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

docs/openapi.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,18 @@ public static async Task<IActionResult> PostSample(
233233

234234
* `ContentType`: defines the content type of the request body payload. eg) `application/json` or `text/xml`
235235
* `BodyType`: defines the type of the request payload.
236-
* `Description`: is the description of the request body payload.
236+
* `Summary`: is the summary of the request payload.
237+
* `Description`: is the description of the request payload.
238+
* `Required`: indicates whether the request payload is mandatory or not.
237239

238240

239-
### `OpenApiResponseBodyAttribute` ###
241+
### `OpenApiResponseWithBodyAttribute` ###
240242

241243
This decorator implements the [Response object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#responseObject) spec.
242244

243245
```csharp
244246
[FunctionName(nameof(PostSample))]
245-
[OpenApiResponseBody(statusCode: HttpStatusCode.OK, contentType: "application/json", bodyType: typeof(SampleResponseModel))]
247+
[OpenApiResponseWithBody(statusCode: HttpStatusCode.OK, contentType: "application/json", bodyType: typeof(SampleResponseModel))]
246248
...
247249
public static async Task<IActionResult> PostSample(
248250
[HttpTrigger(AuthorizationLevel.Function, "post", Route = "samples")] HttpRequest req,
@@ -253,10 +255,31 @@ public static async Task<IActionResult> PostSample(
253255
```
254256

255257
* `StatusCode`: defines the HTTP status code. eg) `HttpStatusCode.OK`
256-
* `ContentType`: defines the content type of the response body payload. eg) `application/json` or `text/xml`
258+
* `ContentType`: defines the content type of the response payload. eg) `application/json` or `text/xml`
257259
* `BodyType`: defines the type of the response payload.
258-
* `Description`: is the description of the response body payload.
259-
* `Summary`: is the summary of the response body payload.
260+
* `Summary`: is the summary of the response.
261+
* `Description`: is the description of the response.
262+
263+
264+
### `OpenApiResponseWithoutBodyAttribute` ###
265+
266+
This decorator implements the [Response object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#responseObject) spec.
267+
268+
```csharp
269+
[FunctionName(nameof(PostSample))]
270+
[OpenApiResponseWithoutBody(statusCode: HttpStatusCode.OK, contentType: "application/json", bodyType: typeof(SampleResponseModel))]
271+
...
272+
public static async Task<IActionResult> PostSample(
273+
[HttpTrigger(AuthorizationLevel.Function, "post", Route = "samples")] HttpRequest req,
274+
ILogger log)
275+
{
276+
...
277+
}
278+
```
279+
280+
* `StatusCode`: defines the HTTP status code. eg) `HttpStatusCode.OK`
281+
* `Summary`: is the summary of the response.
282+
* `Description`: is the description of the response.
260283

261284

262285
## Supported Json.NET Decorators ##

0 commit comments

Comments
 (0)