Skip to content

Commit

Permalink
Allow Created responses to be used as the model (#35)
Browse files Browse the repository at this point in the history
The first of either 200 or 201 is used as the 'ok' result now.
  • Loading branch information
baronfel authored and sergey-tihon committed Jun 22, 2016
1 parent f86d086 commit 890d60a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SwaggerProvider.DesignTime/OperationCompiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ type OperationCompiler (schema:SwaggerObject, defCompiler:DefinitionCompiler) =
ProvidedParameter(paramName, defCompiler.CompileTy methodName paramName x.Type x.Required)]
let retTy =
let okResponse = // BUG : wrong selector
op.Responses |> Array.tryFind (fun (code, resp)->
(code.IsSome && code.Value = 200) || code.IsNone)
op.Responses |> Array.tryFind (fun (code, resp) ->
(code.IsSome && (code.Value = 200 || code.Value = 201)) || code.IsNone)
match okResponse with
| Some (_,resp) ->
match resp.Schema with
Expand Down

0 comments on commit 890d60a

Please sign in to comment.