Skip to content

Commit

Permalink
move set path parameter before loadFromRequest #36
Browse files Browse the repository at this point in the history
  • Loading branch information
lscalese committed Oct 19, 2023
1 parent b7ba4e9 commit 61436fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dc/openapi/server/RESTGenerator.cls
Expand Up @@ -507,10 +507,10 @@ Method AddDispMethod(
}

Do methodDef.Implementation.WriteLine( $Char(9,9) _ $$$FormatText("Set requestMessage = ##class(%1).%New()", messageRequestClass))
Do:setPathParamLine'="" methodDef.Implementation.WriteLine( $Char(9,9) _ setPathParamLine)
Do methodDef.Implementation.WriteLine( $Char(9,9) _ "Do requestMessage.LoadFromRequest(%request)")
Do methodDef.Implementation.WriteLine( $Char(9,9) _ "Set scValidateRequest = requestMessage.RequestValidate()")
Do methodDef.Implementation.WriteLine( $Char(9,9) _ "If $$$ISERR(scValidateRequest) Do ##class(%REST.Impl).%ReportRESTError(..#HTTP400BADREQUEST,$$$ERROR(5001,""Invalid requestMessage object."")) Quit")
Do:setPathParamLine'="" methodDef.Implementation.WriteLine( $Char(9,9) _ setPathParamLine)
Do methodDef.Implementation.WriteLine( $Char(9,9) _ $$$FormatText("Set response = ##class(%1).%2(requestMessage)", ..implClassName, implMethodName))
Do methodDef.Implementation.WriteLine( $Char(9,9) _ $$$FormatText("Do ##class(%1).%WriteResponse(response)",..implClassName))

Expand Down

0 comments on commit 61436fb

Please sign in to comment.