Skip to content

Commit 890d60a

Browse files
baronfelsergey-tihon
authored andcommitted
Allow Created responses to be used as the model (#35)
The first of either 200 or 201 is used as the 'ok' result now.
1 parent f86d086 commit 890d60a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SwaggerProvider.DesignTime/OperationCompiler.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ type OperationCompiler (schema:SwaggerObject, defCompiler:DefinitionCompiler) =
2525
ProvidedParameter(paramName, defCompiler.CompileTy methodName paramName x.Type x.Required)]
2626
let retTy =
2727
let okResponse = // BUG : wrong selector
28-
op.Responses |> Array.tryFind (fun (code, resp)->
29-
(code.IsSome && code.Value = 200) || code.IsNone)
28+
op.Responses |> Array.tryFind (fun (code, resp) ->
29+
(code.IsSome && (code.Value = 200 || code.Value = 201)) || code.IsNone)
3030
match okResponse with
3131
| Some (_,resp) ->
3232
match resp.Schema with

0 commit comments

Comments
 (0)