Skip to content

Changed template function setstatuscode to accept strings instead of int#1139

Merged
tommysitu merged 1 commit into
SpectoLabs:masterfrom
stuioco:change-setstatuscode-to-accept-strings
Jul 20, 2024
Merged

Changed template function setstatuscode to accept strings instead of int#1139
tommysitu merged 1 commit into
SpectoLabs:masterfrom
stuioco:change-setstatuscode-to-accept-strings

Conversation

@stuioco

@stuioco stuioco commented Jul 20, 2024

Copy link
Copy Markdown
Contributor

I have changed the template function setStatusCode to accept strings so that the status code can be generated from an internally nested function, like {{csv}}.

This will now work whereas it crashed before:
{{setStatusCode (csv 'gdcm-provisioning-data' 'Vin' (Request.Body 'jsonpath' '$.Vin') 'Response-Code')}}

I could not find any tests for it so I have not updated the tests.

Thanks
Stu

@stuioco stuioco requested a review from tommysitu July 20, 2024 09:44

@tommysitu tommysitu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a functional test actually, but it should still work because {{ setStatusCode 200 }} still works regardless if the go input param is an int or string type.

@tommysitu tommysitu merged commit 632071f into SpectoLabs:master Jul 20, 2024
@stuioco

stuioco commented Jul 20, 2024 via email

Copy link
Copy Markdown
Contributor Author

@tommysitu

tommysitu commented Jul 20, 2024 via email

Copy link
Copy Markdown
Member

@tommysitu

tommysitu commented Jul 20, 2024 via email

Copy link
Copy Markdown
Member

@stuioco

stuioco commented Jul 20, 2024 via email

Copy link
Copy Markdown
Contributor Author

@stuioco stuioco deleted the change-setstatuscode-to-accept-strings branch August 15, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants