-
Notifications
You must be signed in to change notification settings - Fork 24
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
Added Action method UrlParameters #23
Conversation
Merge pull request NeVeSpl#18 from gregveres/master
…ffset This fixes issue NeVeSpl#13 As pointed out in the issue, .Net Web API actually sends DateTime and DateTimeOffset back and forth between the front end and the back end as strings. This means that the best practice should be to define these values as strings. However, Typewriter originally defined these as the JS Date object. So keeping with Typewriter's lead, we are keeping the Date object as the default, but allowing the user to specify a different value for these date types. This commit adds another argument to ToTypeScriptType that allows the user to specify the Date type. The unit tests have been updated as well as the documentation. And this also affects the Parameter.ToTypeScript function as well. It also gets a new argument. (note: at this point in time there are no unit tests for Parameter.ToTypeScript)
fix for issue NeVeSpl#16 Bug: Action.Url is not using the RoutePrefix attrib…
…ateTimeOffset" This reverts commit 3d4d588.
UrlParameters returns all the parameters for the action, except the on that is marked as the BodyParameter. I have added this method because it seems impossible in the Scriban script to be able to remove a Parameter from the IEnumerable list of parameters, because once you start using the array methods, the array becomes a range and is no longer an IEnumerable so you can't do any more parameter work on it. By providing this Action method, we remove the BodyParam in C# and we retain the type of the array. For this commit, I added a new method to the Weather controller so that I had an example of an action that did not have a body parameter. I needed this to properly test the case without a body parameter. This addition of the method leaked into other tests because now there is an extra action to handle. I also regenerated the documentation so that it picked up the new Action method. The strange thing about that is that it then put all the items in different orders causing a lot more change in this file than should have been.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameters
function returns a little bit more than those parameters used in URL. Instead of creating a new function, I would rather propose to simply add an argument: bool withoutBodyParameter = false
to the existing "Parameters" function.
To get the correct order in BuiltInFunctions.md you have to run DocumentationGenerator project.
Issue NeVeSpl#15 FR: Action.ReturnType should look for ResponseType attribut…
…seType attribute when return type IHttpActionResult" This reverts commit 3496ef7.
This reverts commit 4409730.
In reverting the UrlParameter changes, I somehow wiped out the changes of merging in 1a9a9d3. This just brings my forked master in line with the upstream master
I am withdrawing this PR. It will be replaced with another request that satisfies the request and is based on a cleaner branch. |
This fixes #22
UrlParameters returns all the parameters for the action, except the on that is marked as the BodyParameter.
I have added this method because it seems impossible in the Scriban script to be able to remove a Parameter from the IEnumerable list of parameters, because once you start using the array methods, the array becomes a range and is no longer an IEnumerable so you can't do any more parameter work on it.
By providing this Action method, we remove the BodyParam in C# and we retain the type of the array.
For this commit, I added a new method to the Weather controller so that I had an example of an action that did not have a body parameter. I needed this to properly test the case without a body parameter. This addition of the method leaked into other tests because now there is an extra action to handle.
I also regenerated the documentation so that it picked up the new Action method. The strange thing about that is that it then put all the items in different orders causing a lot more change in this file than should have been.