Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

stuioco
Copy link
Contributor

@stuioco stuioco commented Jul 20, 2024

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
Copy link
Member

@tommysitu tommysitu left a comment

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
3 checks passed
@stuioco
Copy link
Contributor Author

stuioco commented Jul 20, 2024 via email

@tommysitu
Copy link
Member

tommysitu commented Jul 20, 2024 via email

@tommysitu
Copy link
Member

tommysitu commented Jul 20, 2024 via email

@stuioco
Copy link
Contributor Author

stuioco commented Jul 20, 2024 via email

@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